From fd6ed2018b6c9b8aa1de3e3f91a345f60d801271 Mon Sep 17 00:00:00 2001 From: arturzolkowski Date: Sat, 18 Nov 2023 01:30:19 +0100 Subject: [PATCH] fix VisualizationConfiguration default arguments --- artemis/visualizer/_configuration.py | 21 ++++++++++----------- pyproject.toml | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/artemis/visualizer/_configuration.py b/artemis/visualizer/_configuration.py index 2462758..86c82dd 100644 --- a/artemis/visualizer/_configuration.py +++ b/artemis/visualizer/_configuration.py @@ -1,4 +1,4 @@ -from dataclasses import dataclass +from dataclasses import dataclass, field from typing import List from artemis._utilities.domain import InteractionMethod, VisualizationType @@ -160,7 +160,6 @@ def _split_score_config(cls): @classmethod def _cond_depth_config(cls): - graph_config = InteractionGraphConfiguration() graph_config.THRESHOLD_RELEVANT_INTERACTION = 0.6 graph_config.MAX_EDGE_WIDTH = 3 @@ -176,15 +175,15 @@ def _cond_depth_config(cls): @dataclass class VisualizationConfiguration: accepted_visualizations: List[str] - interaction_graph: InteractionGraphConfiguration = InteractionGraphConfiguration() - interaction_matrix: InteractionMatrixConfiguration = ( - InteractionMatrixConfiguration() + interaction_graph: InteractionGraphConfiguration = field(default_factory=InteractionGraphConfiguration) + interaction_matrix: InteractionMatrixConfiguration = field(default_factory=InteractionMatrixConfiguration) + interaction_bar_chart_ova: InteractionVersusAllConfiguration = field( + default_factory=InteractionVersusAllConfiguration ) - interaction_bar_chart_ova: InteractionVersusAllConfiguration = ( - InteractionVersusAllConfiguration() + interaction_bar_chart_ovo: InteractionVersusOneConfiguration = field( + default_factory=InteractionVersusOneConfiguration ) - interaction_bar_chart_ovo: InteractionVersusOneConfiguration = ( - InteractionVersusOneConfiguration() + lollipop: LollipopSplitScoreConfiguration = field(default_factory=LollipopSplitScoreConfiguration) + interaction_bar_chart_conditional: BarChartConditionalDepthConfiguration = field( + default_factory=BarChartConditionalDepthConfiguration ) - lollipop: LollipopSplitScoreConfiguration = LollipopSplitScoreConfiguration() - interaction_bar_chart_conditional: BarChartConditionalDepthConfiguration = BarChartConditionalDepthConfiguration() diff --git a/pyproject.toml b/pyproject.toml index 28afb11..cdcf14e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "pyartemis" packages = [ { include = "artemis" } ] -version = "0.1.4.9000" +version = "0.1.5" description = "A Python package with explanation methods for extraction of feature interactions from predictive models" readme = "README.md" documentation = "https://pyartemis.github.io/"