Psychrochart

Latest version: v0.11.1

Safety actively analyzes 693883 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

0.9.0

Define new enclosed areas in chart between constant RH lines and constant volume or enthalpy values,
and enable full potencial for SVG customization by including CSS and/or `<defs>` inside it.

Changes

- โœจ Add new kind of overlay **zones 'enthalpy-rh' and 'volume-rh'**, to define chart areas delimited between 2 constant enthalpy or volume lines, and 2 constant humidity lines
- ๐ŸŽจ Add `chart.remove_zones()` method, like the existent `.remove_legend()` and `.remove_annotations()`, to clear matplotlib current Axes from each kind of annotated objects
- ๐Ÿ› Fix artists registry not mirroring objects in plot, by setting a new one each time `chart.plot()` is invoked
- โ™ป๏ธ Set gid for 'chart_legend_background' item if frameon is enabled
- โœจ Pass **optional CSS and SVG <defs>** to `chart.make_svg()`, to include extra-styling inside the produced SVG ๐ŸŒˆ
- โœจ Add method `chart.plot_over_saturated_zone()` to create a filled patch in the over-saturated zone of the psychrochart, to colorize that area
- ๐Ÿฆ„ tests: Add dynamic effects and CSS rules to splash chart for a show-off of SVG styling capabilities
- ๐Ÿš€ env: Bump version and update CHANGELOG

0.8.0

Now all chart-data parameters, including the overlayed zones, are included in the `ChartConfig`,
and generation of curves only happens when chart is plotted (or saved to disk).

Any change in the chart configuration will trigger a data-regen for all items before plotting.

When plotting over some matplotlib `Axes`, all objects created have meaningful (and deterministic) ids,
and are tracked and accessible under `chart.artists`, for easier customization of single matplotlib objects,
also adding a **recognizable hierarchy** in generated SVGs, (enabling potential for **CSS over SVG charts** ๐ŸŒˆ)

Changes

- โœจ Name each matplotlib `Artist` obj in plot with custom readable IDs, for easier recognition and **readable object hierarchy in SVGs**, and maintain a registry of all objects in plot to access them by kind under `chart.artists` property, allowing fine-grain control to customize all details in the psychrochart
- โ™ป๏ธ Refactor chart 'zones' and store zone definitions in ChartConfig, to regenerate plot patches (closed `PsychroCurve`, with `ZoneStyle`) on-demand, same as the other chart curves, generating new 'xy' points when config is changed. If `ChartParams.with_zones` is enabled, but there are no zones in config when chart is created, the default winter/summer 'dbt-rh' zones are added.
- โšก๏ธ Add **lazy generation** of psychro curves to avoid updating the chart data until it's needed to plot, and add a `chart.process_chart()` method to trigger data regeneration if the chart config has changed or there is no chart data yet
- ๐Ÿ’ฅ Make `chart.saturation` a single `PsychroCurve`, instead of a collection of curves
- โœ… tests: Add unit tests for new ChartRegistry and adapt to behaviour changes and readable hierarchy in SVG output
- ๐Ÿ“ Update example notebook showing `chart.artists` usage
- ๐Ÿš€ env: Update deps, bump version, and update CHANGELOG

0.7.0

Maintenance-only update, without new features.

Changes

- ๐Ÿ’ฅ Remove plotting methods from `PsychroCurve`/`PsychroCurves` for a more functional approach, using methods in `plot_logic.py`
- ๐Ÿ’ฅ Add `PsychroCurve.internal_value` field, to identify the trigger value for each curve (constant H/V/RH...), and evolve validation of data arrays
- โœ… tests: Increase test coverage and optimize tests for faster run (~2x)
- ๐Ÿ“ฆ๏ธ env: Add slugify to deps and bump version

0.6.0

Before, chart customize was done by creating a new `Psychrochart` object based on some modified chart configuration,
so creating custom plots, or even changing chart limits, was _challenging_ ๐Ÿ˜“

**Now**, when `chart.config` changes, any call to `chart.save()`, `chart.make_svg()`, or `chart.plot()`
will regenerate the chart data (limits, enabled curves, styling, etc.) before plotting, with only the visible curves inside limits,
(no more 0-size artifacts in SVGs, and most errors because some var is out of range should be gone now ๐Ÿคž)

Changes

- โ™ป๏ธ Update example notebook with API changes, and using `chart.make_svg()` as the recommended method to generate SVGs
- ๐Ÿ’„ **Parse colors into RGBA values**, so "red", "FF0000", "FF0000FF" produce the same float repr [1., 0., 0., 1.]
- ๐Ÿ—๏ธ Add **mutation control for configuration models**, and use it to check if there is any config change before creating a chart, triggering a chart-data regeneration if necessary
- ๐Ÿ”ง Add new field `ChartFigure.dpi` to chart config, for easy customization of matplotlib Figure DPI
- โšก๏ธ Optimize generation of psychrometric curves inside plot limits

0.5.0

๐Ÿงน Internal evolution to update the code style to the latest versions and de facto standards, with better typing, input validation, and serialization.
Hardly any new features, but some bug fixes.

Changes

- ๐Ÿ—๏ธ Add [`pydantic`](https://docs.pydantic.dev/latest/) models for chart + annotations styling and config, for better (de)serialization and parameter validation.

New models are:

- `CurveStyle`, `LabelStyle`, `TickStyle`, `ZoneStyle` := to parse & handle defaults for matplotlib styling parameters
- `ChartConfig` for the full chart configuration, including sub-models `ChartFigure`, `ChartLimits`, and `ChartParams`, to mirror the old obfuscated config, with the same default values as before
- `ChartPoint` and `ChartSeries` for styled single-point or array-data annotations
- `ChartLine` for styled connectors between named points (now without outline 'marker' by default)
- `ChartArea` for styled convex areas delimited by a list of named points
- `ChartAnnots` as container for all of the above
- `ChartZone` (and `ChartZones` as a list), for styled fixed areas (like the default winter/summer comfort zones)

- โ™ป๏ธ Evolve load methods to parse inputs into pydantic models with _near-zero_ (expected ๐Ÿคž) breaks when reading old data
- ๐Ÿ’ฅ Rework `PsychroChart` class to work with pydantic `PsychroChartModel`. As the chart is now a pydantic model, there is a `chart.json(...)` method, and loading from serialized data is available with `PsychroChart.parse_file(` / `.validate(` / etc ๐Ÿคฉ
> **BREAKING-CHANGE**: Now the chart creation from a configuration key/file/dict is done with **`PsychroChart.create(config)`**, instead of old `PsychroChart(config)`
- โœจ Add `.make_svg()` method to produce a SVG file as text, and evolve `.save(...)` with optional `canvas_cls: Type[FigureCanvasBase]`, to select kind of matplotlib canvas where to print the chart
- โœจ Support file creation in subfolders with chart.save(dest)
- ๐Ÿšš rsc: Deterministic SVG output in tests, and README images without date metadata
- โœ… tests: Adapt API changes in unit tests, remove usages of `unittest.TestCase`, add new tests for pydantic models, annotations, and serialization methods.

0.4.0

Changes

- ๐Ÿ› (from simplynail in 25): fixing chart setup error with gca() call for recent Matplotlib versions
- ๐Ÿ™ˆ Add missing .gitignore
- ๐Ÿ’ฅ **Update dependencies + minimal Python version to 3.10** to work with latest releases ๐Ÿ„
- ๐ŸŽจ lint: Apply `isort` and `prettier`, and update typing
- ๐ŸŽจ lint: Evolve pre-commit config with ruff
- ๐Ÿฑ tests: Update SVG outputs from latest matplotlib
- ๐Ÿ› Fix saving PNG with transparent background, by swapping `transparent=True` with `facecolor="none"`
- ๐Ÿ—‘๏ธ Use `psychrolib.GetTDryBulbFromMoistAirVolumeAndHumRatio`, removing local method from here, now that it's included there
- ๐Ÿ‘ท ci: **Swap travis CI config with GH actions to test + publish**

Page 2 of 3

ยฉ 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.