From c9fd904e4f2ea56aef8424c9b2546a9c0e2648e1 Mon Sep 17 00:00:00 2001 From: Chen Kasirer Date: Wed, 13 Mar 2024 10:26:43 +0100 Subject: [PATCH] using default_factory in default config --- CHANGELOG.md | 2 ++ src/compas_notebook/config.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 466514c..8f49ea6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +* Fixed `ValueError` when starting viewer for the first time with default config. + ### Removed diff --git a/src/compas_notebook/config.py b/src/compas_notebook/config.py index 147bb1b..87fb0c6 100644 --- a/src/compas_notebook/config.py +++ b/src/compas_notebook/config.py @@ -19,7 +19,7 @@ class CameraConfig: @dataclass class ViewConfig: viewport: Literal["top", "perspective"] = "perspective" - background: Color = Color.from_hex("#eeeeee") + background: Color = field(default_factory=lambda: Color.from_hex("#eeeeee")) width: float = 1100 height: float = 580 show_grid: bool = True