35 minimal heatmap code raising an error#37
Merged
Conversation
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR addresses multiple open issues around heatmap export errors, color handling, and warning management in tests for tikzplotly, while also refactoring shared marker-option logic.
Changes:
- Fix heatmap image output directory creation when
img_namehas no dirname (e.g., default"heatmap.png"). - Improve/adjust color conversion behavior (notably
rgba(...)parsing and unsupported color inputs) and add dedicated color tests. - Standardize warning handling in pytest tests and refactor scatter/scatter3d marker option code into a shared utility.
Reviewed changes
Copilot reviewed 38 out of 41 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tox.ini | Switch tox deps to requirements.txt and add plotly_get_chrome step before pytest. |
| requirements.txt | Add pytest-related packages to shared requirements list. |
| pyproject.toml | Add pytest filterwarnings configuration. |
| .gitignore | Ignore MkDocs site/** output; minor formatting cleanup. |
| docs/develop/tests.md | Fix typo in documentation text. |
| docs/develop/contributing.md | Improve wording, update admonition type, document pytest warning ignores. |
| src/tikzplotly/_heatmap.py | Prevent os.makedirs('') by using '.' when dirname is empty. |
| src/tikzplotly/_color.py | Change unsupported color handling and enhance rgba(...) parsing (optional alpha). |
| src/tikzplotly/_utils.py | Simplify sanitize_char logic for spaces/non-ascii/non-printable chars. |
| src/tikzplotly/_trace_utils.py | New shared helper for scatter-like marker option assembly. |
| src/tikzplotly/_scatter.py | Use shared marker helper for 2D scatter marker options. |
| src/tikzplotly/_scatter3d.py | Use shared marker helper for 3D scatter marker options. |
| src/tikzplotly/_histogram.py | Factor histnorm handling into treat_histnorm() and add empty-histogram behavior. |
| src/tikzplotly/_data_container.py | Adjust add_data3d() return value (currently inconsistent between branches). |
| src/tikzplotly/_polar.py | Update DataContainer import path casing. |
| src/tikzplotly/_save.py | Update DataContainer import path casing; adjust 3D data add call and string sanitization. |
| tests/test_colors.py | New tests covering multiple color input formats and warning cases. |
| tests/test_colors/test_colors_transparent_background_reference.tex | New/updated reference for transparent background handling. |
| tests/test_colors/test_colors_rgba-with-opacity_reference.tex | New reference output for rgba color input. |
| tests/test_colors/test_colors_rgba-without-opacity_reference.tex | New reference output for rgba color input without alpha. |
| tests/test_colors/test_colors_rgb_reference.tex | New reference output for rgb color input. |
| tests/test_colors/test_colors_hex_reference.tex | New reference output for hex color input. |
| tests/test_colors/test_colors_named-color_reference.tex | New reference output for named color input. |
| tests/test_colors/test_colors_colors-dict-hit_reference.tex | New reference output for plotly named color-dict hit. |
| tests/test_colors/test_colors_numpy-array_reference.tex | New reference output for numpy-array color input (unsupported). |
| tests/test_colors/test_colors_non-string_reference.tex | New reference output for non-string color input (unsupported). |
| tests/test_colors/test_colors_none_reference.tex | New reference output for None color input. |
| tests/test_specific.py | Update tests to assert warnings; add empty-histogram test case. |
| tests/test_specific/test_specific_empty_histogram_reference.tex | New reference output for empty histogram case. |
| tests/test_scatter.py | Update tests to assert/conditionally expect warnings. |
| tests/test_scatter3d.py | Update tests to assert/conditionally expect warnings for unsupported color-from-data. |
| tests/test_scatter3d/test_scatter3d_2_markers_reference.tex | Update reference output reflecting marker option/color changes. |
| tests/test_scatter3d/test_scatter3d_2_markers+lines_reference.tex | Update reference output reflecting marker option/color changes. |
| tests/test_histograms.py | Update tests to assert/conditionally expect warnings around histnorm/histfunc. |
| tests/test_polar.py | Update test to expect warning for unsupported barpolar. |
| tests/test_markers.py | Update test to conditionally expect warning for unsupported dotted markers. |
| tests/test_markers/test_markers_1_reference.tex | Update reference output (marker option ordering/format). |
| tests/test_markers/test_markers_2_reference.tex | Update reference output (marker option ordering/format). |
| tests/test_markers/test_markers_3_reference.tex | Update reference output (marker option ordering/format). |
| tests/test_markers/test_markers_angle_reference.tex | Update reference output (marker option ordering/format). |
| tests/test_heatmap.py | Update tests to expect warnings and adjust date generation; rename empty-trace helper. |
Comments suppressed due to low confidence (1)
src/tikzplotly/_data_container.py:189
DataContainer.add_data3d()now returns a single value when creating new data (return data_obj.name) but still returns a 2-tuple in the cache-hit path (return data.name, data.z_name). This makes the return type inconsistent and can break callers (e.g.,get_tikz_code()now assumes a string). Update the cache-hit branch to return the same type (and update the docstring accordingly).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Uh oh!
There was an error while loading. Please reload this page.