Skip to content

`gum.config` :the configuration object for pyAgrum

Creative Commons LicenseaGrUMinteractive online version
import pyagrum as gum
print("=" * 35)
print(gum.config)
print("=" * 35)
===================================
[core]
default_maxnumberofthreads = 24
[notebook]
tensor_visible_digits = 4
tensor_with_colors = True
tensor_color_0 = #FF7F64
tensor_color_1 = #7FFF64
tensor_with_fraction = False
tensor_fraction_limit = 50
tensor_fraction_round_error = 1e-6
tensor_fraction_with_latex = True
histogram_horizontal_visible_digits = 2
histogram_vertical_visible_digits = 2
histogram_horizontal_threshold = 8
histogram_line_threshold = 40
histogram_color = darkseagreen
histogram_edge_color = darkgreen
histogram_use_percent = True
histogram_discretized_visualisation = histogram
histogram_discretized_scale = 1.0
histogram_mode = compact
histogram_epsilon = 1e-8
tensor_parent_values = merge
figure_facecolor = #E0E0E0
flow_background_color = transparent
flow_border_color = transparent
flow_border_width = 0
graph_format = svg
show_inference_time = True
default_arc_color = #4A4A4A
default_node_bgcolor = #404040
default_node_fgcolor = white
evidence_bgcolor = sandybrown
evidence_fgcolor = black
default_node_cmap = Pastel1
default_arc_cmap = BuGn
default_edge_cmap = BuGn
default_graph_size = 5
default_graph_inference_size = 8
graph_rankdir = TB
graph_layout = dot
default_markovrandomfield_view = factorgraph
junctiontree_graph_size = 10
junctiontree_with_names = True
junctiontree_separator_bgcolor = palegreen
junctiontree_separator_fgcolor = black
junctiontree_separator_fontsize = 8
junctiontree_clique_bgcolor = burlywood
junctiontree_clique_fgcolor = black
junctiontree_clique_fontsize = 10
junctiontree_map_cliquescale = 0.3
junctiontree_map_sepscale = 0.1
junctiontree_map_edgelen = 1
junctiontree_map_size = 10
graphdiff_missing_style = dashed
graphdiff_missing_color = red
graphdiff_overflow_style = dashed
graphdiff_overflow_color = purple
graphdiff_reversed_style = solid
graphdiff_reversed_color = purple
graphdiff_correct_style = solid
graphdiff_correct_color = grey
[BN]
allow_modification_when_saving = False
[factorgraph]
default_node_bgcolor = coral
default_node_fgcolor = black
default_factor_bgcolor = burlywood
edge_length = 0.7
edge_length_inference = 0.9
graph_layout = neato
[dynamicBN]
default_graph_size = 6
[influenceDiagram]
default_graph_size = 6
default_chance_bgcolor = #808080
default_chance_fgcolor = white
default_utility_bgcolor = #50508A
default_utility_fgcolor = white
default_decision_bgcolor = #9A5050
default_decision_fgcolor = white
chance_shape = ellipse
utility_shape = hexagon
decision_shape = box
decision_arc_style = tapered, bold, dotted
utility_arc_style = dashed
default_id_size = 6
default_id_inference_size = 6
utility_visible_digits = 2
utility_show_stdev = True
utility_show_loss = False
[credalnet]
default_node_bgcolor = #404040
default_node_fgcolor = white
histo_max_color = #BBFFAA
[causal]
show_latent_names = False
latex_do_prefix = \text{do}(
latex_do_suffix = )
default_graph_size = 2.5
default_node_bgcolor = #404040
default_node_fgcolor = white
default_latent_bgcolor = #A08080
default_latent_fgcolor = black
[ROC]
draw_color = #008800
fill_color = #AAEEAA
[ctbn]
show_latent_names = False
default_graph_size = 2.5
default_node_bgcolor = #404040
default_node_fgcolor = white
default_latent_bgcolor = #A08080
default_latent_fgcolor = black
[bnmixture]
default_graph_size = 5
default_line_size = 1.0
default_head_size = 0.25
default_arrow_type = normal
default_arc_cmap = Greens
default_arc_color = #4A4A4A
default_arc_style = solid
default_node_bgcolor = #404040
default_node_fgcolor = white
default_layout = fdp
default_overlap = 0
default_bar_capsize = 1.5
default_bar_height = 0.8
default_boot_histo_scale = 2.0
default_histo_scale = 1.0
correct_arc_style = solid
correct_arc_color = green
incorrect_arc_style = dashed
incorrect_arc_color = green
left_quantile = 0.2
right_quantile = 0.8
[Pickle]
add_version = True
add_date = True
===================================

As far as it can be done with Python, gum.config is a singleton. The configuration is a mix between the defaults (which exactly define the possible section and property) and a file pyagrum.ini (if present in the current folder) that contains only the changed properties.

section and key are case insensitive.

config constantly keeps track of the differences between defaults and actual values :

Section titled “config constantly keeps track of the differences between defaults and actual values :”
gum.config["dynamicBN", "default_graph_size"] = 10
print("Configuration only for the current session")
print("-" * 40)
gum.config.diff()
Configuration only for the current session
----------------------------------------
[dynamicBN]
default_graph_size = 10
## if there is a local modification, __repr__ shows only the diff other wise it show all properties
gum.config
[dynamicBN]
default_graph_size = 10
## __str__ shows all the properties
print(gum.config)
[core]
default_maxnumberofthreads = 24
[notebook]
tensor_visible_digits = 4
tensor_with_colors = True
tensor_color_0 = #FF7F64
tensor_color_1 = #7FFF64
tensor_with_fraction = False
tensor_fraction_limit = 50
tensor_fraction_round_error = 1e-6
tensor_fraction_with_latex = True
histogram_horizontal_visible_digits = 2
histogram_vertical_visible_digits = 2
histogram_horizontal_threshold = 8
histogram_line_threshold = 40
histogram_color = darkseagreen
histogram_edge_color = darkgreen
histogram_use_percent = True
histogram_discretized_visualisation = histogram
histogram_discretized_scale = 1.0
histogram_mode = compact
histogram_epsilon = 1e-8
tensor_parent_values = merge
figure_facecolor = #E0E0E0
flow_background_color = transparent
flow_border_color = transparent
flow_border_width = 0
graph_format = svg
show_inference_time = True
default_arc_color = #4A4A4A
default_node_bgcolor = #404040
default_node_fgcolor = white
evidence_bgcolor = sandybrown
evidence_fgcolor = black
default_node_cmap = Pastel1
default_arc_cmap = BuGn
default_edge_cmap = BuGn
default_graph_size = 5
default_graph_inference_size = 8
graph_rankdir = TB
graph_layout = dot
default_markovrandomfield_view = factorgraph
junctiontree_graph_size = 10
junctiontree_with_names = True
junctiontree_separator_bgcolor = palegreen
junctiontree_separator_fgcolor = black
junctiontree_separator_fontsize = 8
junctiontree_clique_bgcolor = burlywood
junctiontree_clique_fgcolor = black
junctiontree_clique_fontsize = 10
junctiontree_map_cliquescale = 0.3
junctiontree_map_sepscale = 0.1
junctiontree_map_edgelen = 1
junctiontree_map_size = 10
graphdiff_missing_style = dashed
graphdiff_missing_color = red
graphdiff_overflow_style = dashed
graphdiff_overflow_color = purple
graphdiff_reversed_style = solid
graphdiff_reversed_color = purple
graphdiff_correct_style = solid
graphdiff_correct_color = grey
[BN]
allow_modification_when_saving = False
[factorgraph]
default_node_bgcolor = coral
default_node_fgcolor = black
default_factor_bgcolor = burlywood
edge_length = 0.7
edge_length_inference = 0.9
graph_layout = neato
[dynamicBN]
default_graph_size = 10
[influenceDiagram]
default_graph_size = 6
default_chance_bgcolor = #808080
default_chance_fgcolor = white
default_utility_bgcolor = #50508A
default_utility_fgcolor = white
default_decision_bgcolor = #9A5050
default_decision_fgcolor = white
chance_shape = ellipse
utility_shape = hexagon
decision_shape = box
decision_arc_style = tapered, bold, dotted
utility_arc_style = dashed
default_id_size = 6
default_id_inference_size = 6
utility_visible_digits = 2
utility_show_stdev = True
utility_show_loss = False
[credalnet]
default_node_bgcolor = #404040
default_node_fgcolor = white
histo_max_color = #BBFFAA
[causal]
show_latent_names = False
latex_do_prefix = \text{do}(
latex_do_suffix = )
default_graph_size = 2.5
default_node_bgcolor = #404040
default_node_fgcolor = white
default_latent_bgcolor = #A08080
default_latent_fgcolor = black
[ROC]
draw_color = #008800
fill_color = #AAEEAA
[ctbn]
show_latent_names = False
default_graph_size = 2.5
default_node_bgcolor = #404040
default_node_fgcolor = white
default_latent_bgcolor = #A08080
default_latent_fgcolor = black
[bnmixture]
default_graph_size = 5
default_line_size = 1.0
default_head_size = 0.25
default_arrow_type = normal
default_arc_cmap = Greens
default_arc_color = #4A4A4A
default_arc_style = solid
default_node_bgcolor = #404040
default_node_fgcolor = white
default_layout = fdp
default_overlap = 0
default_bar_capsize = 1.5
default_bar_height = 0.8
default_boot_histo_scale = 2.0
default_histo_scale = 1.0
correct_arc_style = solid
correct_arc_color = green
incorrect_arc_style = dashed
incorrect_arc_color = green
left_quantile = 0.2
right_quantile = 0.8
[Pickle]
add_version = True
add_date = True
print(gum.config["notebook", "evidence_bgcolor"])
print(gum.config.get("notebook", "evidence_bgcolor"))
sandybrown
sandybrown
gum.config["notebook", "evidence_bgcolor"] = "papayawhip"
gum.config["causal", "default_graph_size"] = 1.9
gum.config # once again, only the diff with defaults
[notebook]
evidence_bgcolor = papayawhip
[dynamicBN]
default_graph_size = 10
[causal]
default_graph_size = 1.9

The structure section.key is fixed by default and readonly : one can only change the value of an existing property

try:
gum.config["AAA", "OOO"] = 1
except SyntaxError as e:
print("Syntax error : {}".format(e.msg))
Syntax error : Section 'AAA' unknown in pyAgrum configuration.
try:
gum.config["causal", "OOO"] = 1
except SyntaxError as e:
print("Syntax error : {}".format(e.msg))
Syntax error : Key 'causal,OOO' unknown in pyAgrum configuration.

All the properties are stored as string !

gum.config["notebook", "default_graph_size"]
'5'
gum.config["notebook", "default_graph_size"] = 10
gum.config["notebook", "default_graph_size"]
'10'

… but can be typed using asInt, asFloat, asBool

Section titled “… but can be typed using asInt, asFloat, asBool”
gum.config["dynamicBN", "default_graph_size"]
'10'
gum.config.asInt["dynamicBN", "default_graph_size"]
10
print(type(gum.config["dynamicBN", "default_graph_size"]))
print(type(gum.config.asInt["dynamicBN", "default_graph_size"]))

<class ‘str’> <class ‘int’>

if gum.config["causal", "show_latent_names"] == "False":
print("not very convenient test")
if not gum.config.asBool["causal", "show_latent_names"]:
print("better test")
not very convenient test
better test

The configuration can be saved in the current folder (gum.config.save()).

The configuration can be restored from the default (reset) or the current saved state (reload).

gum.config.reset() # back to defaults
gum.config # no diff => shows all the properties
# no customized property
[core]
default_maxnumberofthreads = 24
[notebook]
tensor_visible_digits = 4
tensor_with_colors = True
tensor_color_0 = #FF7F64
tensor_color_1 = #7FFF64
tensor_with_fraction = False
tensor_fraction_limit = 50
tensor_fraction_round_error = 1e-6
tensor_fraction_with_latex = True
histogram_horizontal_visible_digits = 2
histogram_vertical_visible_digits = 2
histogram_horizontal_threshold = 8
histogram_line_threshold = 40
histogram_color = darkseagreen
histogram_edge_color = darkgreen
histogram_use_percent = True
histogram_discretized_visualisation = histogram
histogram_discretized_scale = 1.0
histogram_mode = compact
histogram_epsilon = 1e-8
tensor_parent_values = merge
figure_facecolor = #E0E0E0
flow_background_color = transparent
flow_border_color = transparent
flow_border_width = 0
graph_format = svg
show_inference_time = True
default_arc_color = #4A4A4A
default_node_bgcolor = #404040
default_node_fgcolor = white
evidence_bgcolor = sandybrown
evidence_fgcolor = black
default_node_cmap = Pastel1
default_arc_cmap = BuGn
default_edge_cmap = BuGn
default_graph_size = 5
default_graph_inference_size = 8
graph_rankdir = TB
graph_layout = dot
default_markovrandomfield_view = factorgraph
junctiontree_graph_size = 10
junctiontree_with_names = True
junctiontree_separator_bgcolor = palegreen
junctiontree_separator_fgcolor = black
junctiontree_separator_fontsize = 8
junctiontree_clique_bgcolor = burlywood
junctiontree_clique_fgcolor = black
junctiontree_clique_fontsize = 10
junctiontree_map_cliquescale = 0.3
junctiontree_map_sepscale = 0.1
junctiontree_map_edgelen = 1
junctiontree_map_size = 10
graphdiff_missing_style = dashed
graphdiff_missing_color = red
graphdiff_overflow_style = dashed
graphdiff_overflow_color = purple
graphdiff_reversed_style = solid
graphdiff_reversed_color = purple
graphdiff_correct_style = solid
graphdiff_correct_color = grey
[BN]
allow_modification_when_saving = False
[factorgraph]
default_node_bgcolor = coral
default_node_fgcolor = black
default_factor_bgcolor = burlywood
edge_length = 0.7
edge_length_inference = 0.9
graph_layout = neato
[dynamicBN]
default_graph_size = 6
[influenceDiagram]
default_graph_size = 6
default_chance_bgcolor = #808080
default_chance_fgcolor = white
default_utility_bgcolor = #50508A
default_utility_fgcolor = white
default_decision_bgcolor = #9A5050
default_decision_fgcolor = white
chance_shape = ellipse
utility_shape = hexagon
decision_shape = box
decision_arc_style = tapered, bold, dotted
utility_arc_style = dashed
default_id_size = 6
default_id_inference_size = 6
utility_visible_digits = 2
utility_show_stdev = True
utility_show_loss = False
[credalnet]
default_node_bgcolor = #404040
default_node_fgcolor = white
histo_max_color = #BBFFAA
[causal]
show_latent_names = False
latex_do_prefix = \text{do}(
latex_do_suffix = )
default_graph_size = 2.5
default_node_bgcolor = #404040
default_node_fgcolor = white
default_latent_bgcolor = #A08080
default_latent_fgcolor = black
[ROC]
draw_color = #008800
fill_color = #AAEEAA
[ctbn]
show_latent_names = False
default_graph_size = 2.5
default_node_bgcolor = #404040
default_node_fgcolor = white
default_latent_bgcolor = #A08080
default_latent_fgcolor = black
[bnmixture]
default_graph_size = 5
default_line_size = 1.0
default_head_size = 0.25
default_arrow_type = normal
default_arc_cmap = Greens
default_arc_color = #4A4A4A
default_arc_style = solid
default_node_bgcolor = #404040
default_node_fgcolor = white
default_layout = fdp
default_overlap = 0
default_bar_capsize = 1.5
default_bar_height = 0.8
default_boot_histo_scale = 2.0
default_histo_scale = 1.0
correct_arc_style = solid
correct_arc_color = green
incorrect_arc_style = dashed
incorrect_arc_color = green
left_quantile = 0.2
right_quantile = 0.8
[Pickle]
add_version = True
add_date = True
try:
gum.config.load() # reload pyagrum.ini
except FileNotFoundError:
pass # no pyagrum.ini in the folder
gum.config
# no customized property
[core]
default_maxnumberofthreads = 24
[notebook]
tensor_visible_digits = 4
tensor_with_colors = True
tensor_color_0 = #FF7F64
tensor_color_1 = #7FFF64
tensor_with_fraction = False
tensor_fraction_limit = 50
tensor_fraction_round_error = 1e-6
tensor_fraction_with_latex = True
histogram_horizontal_visible_digits = 2
histogram_vertical_visible_digits = 2
histogram_horizontal_threshold = 8
histogram_line_threshold = 40
histogram_color = darkseagreen
histogram_edge_color = darkgreen
histogram_use_percent = True
histogram_discretized_visualisation = histogram
histogram_discretized_scale = 1.0
histogram_mode = compact
histogram_epsilon = 1e-8
tensor_parent_values = merge
figure_facecolor = #E0E0E0
flow_background_color = transparent
flow_border_color = transparent
flow_border_width = 0
graph_format = svg
show_inference_time = True
default_arc_color = #4A4A4A
default_node_bgcolor = #404040
default_node_fgcolor = white
evidence_bgcolor = sandybrown
evidence_fgcolor = black
default_node_cmap = Pastel1
default_arc_cmap = BuGn
default_edge_cmap = BuGn
default_graph_size = 5
default_graph_inference_size = 8
graph_rankdir = TB
graph_layout = dot
default_markovrandomfield_view = factorgraph
junctiontree_graph_size = 10
junctiontree_with_names = True
junctiontree_separator_bgcolor = palegreen
junctiontree_separator_fgcolor = black
junctiontree_separator_fontsize = 8
junctiontree_clique_bgcolor = burlywood
junctiontree_clique_fgcolor = black
junctiontree_clique_fontsize = 10
junctiontree_map_cliquescale = 0.3
junctiontree_map_sepscale = 0.1
junctiontree_map_edgelen = 1
junctiontree_map_size = 10
graphdiff_missing_style = dashed
graphdiff_missing_color = red
graphdiff_overflow_style = dashed
graphdiff_overflow_color = purple
graphdiff_reversed_style = solid
graphdiff_reversed_color = purple
graphdiff_correct_style = solid
graphdiff_correct_color = grey
[BN]
allow_modification_when_saving = False
[factorgraph]
default_node_bgcolor = coral
default_node_fgcolor = black
default_factor_bgcolor = burlywood
edge_length = 0.7
edge_length_inference = 0.9
graph_layout = neato
[dynamicBN]
default_graph_size = 6
[influenceDiagram]
default_graph_size = 6
default_chance_bgcolor = #808080
default_chance_fgcolor = white
default_utility_bgcolor = #50508A
default_utility_fgcolor = white
default_decision_bgcolor = #9A5050
default_decision_fgcolor = white
chance_shape = ellipse
utility_shape = hexagon
decision_shape = box
decision_arc_style = tapered, bold, dotted
utility_arc_style = dashed
default_id_size = 6
default_id_inference_size = 6
utility_visible_digits = 2
utility_show_stdev = True
utility_show_loss = False
[credalnet]
default_node_bgcolor = #404040
default_node_fgcolor = white
histo_max_color = #BBFFAA
[causal]
show_latent_names = False
latex_do_prefix = \text{do}(
latex_do_suffix = )
default_graph_size = 2.5
default_node_bgcolor = #404040
default_node_fgcolor = white
default_latent_bgcolor = #A08080
default_latent_fgcolor = black
[ROC]
draw_color = #008800
fill_color = #AAEEAA
[ctbn]
show_latent_names = False
default_graph_size = 2.5
default_node_bgcolor = #404040
default_node_fgcolor = white
default_latent_bgcolor = #A08080
default_latent_fgcolor = black
[bnmixture]
default_graph_size = 5
default_line_size = 1.0
default_head_size = 0.25
default_arrow_type = normal
default_arc_cmap = Greens
default_arc_color = #4A4A4A
default_arc_style = solid
default_node_bgcolor = #404040
default_node_fgcolor = white
default_layout = fdp
default_overlap = 0
default_bar_capsize = 1.5
default_bar_height = 0.8
default_boot_histo_scale = 2.0
default_histo_scale = 1.0
correct_arc_style = solid
correct_arc_color = green
incorrect_arc_style = dashed
incorrect_arc_color = green
left_quantile = 0.2
right_quantile = 0.8
[Pickle]
add_version = True
add_date = True
import pyagrum.lib.notebook as gnb
bn = gum.fastBN("D->C<-A->B[4];A->E")
bn.cpt("B")
B
A
0
1
2
3
0
0.27230.31480.40660.0063
1
0.06640.51010.32300.1004
gum.config["notebook", "tensor_visible_digits"] = 1
bn.cpt("B")
B
A
0
1
2
3
0
0.30.30.40.0
1
0.10.50.30.1
gum.config["notebook", "tensor_color_0"] = "#AA00AA"
gum.config["notebook", "tensor_color_1"] = "#00FFAA"
bn.cpt("B")
B
A
0
1
2
3
0
0.30.30.40.0
1
0.10.50.30.1
gum.config["notebook", "tensor_visible_digits"] = 4
gnb.flow.add(bn.cpt("B"), "Ugly float")
gum.config["notebook", "tensor_visible_digits"] = 1
gnb.flow.add(bn.cpt("B"), "Ugly 1digit-float")
gum.config["notebook", "tensor_with_fraction"] = True
gum.config["notebook", "tensor_fraction_with_latex"] = False
gum.config["notebook", "tensor_fraction_limit"] = 2000
gnb.flow.add(bn.cpt("B"), "Simple fraction")
gum.config["notebook", "tensor_fraction_with_latex"] = True
gnb.flow.add(bn.cpt("B"), "Sophisticated fraction with LaTeX")
gnb.flow.display()
B
A
0
1
2
3
0
0.27230.31480.40660.0063
1
0.06640.51010.32300.1004

Ugly float
B
A
0
1
2
3
0
0.30.30.40.0
1
0.10.50.30.1

Ugly 1digit-float
B
A
0
1
2
3
0
394/1447345/1096503/12373/476
1
39/587253/496293/90723/229

Simple fraction
B
A
0
1
2
3
0

3941447\frac{394}{1447}

3451096\frac{345}{1096}

5031237\frac{503}{1237}

3476\frac{3}{476}

1

39587\frac{39}{587}

253496\frac{253}{496}

293907\frac{293}{907}

23229\frac{23}{229}


Sophisticated fraction with LaTeX
gnb.sideBySide(bn, gnb.getInference(bn, evs={"A": 1}, targets={"B"}))
G A A C C A->C B B A->B E E A->E D D D->C
structs Inference in   1.45ms D D C C D->C A A A->C B 2025-10-29T14:42:51.234293 image/svg+xml Matplotlib v3.10.7, A->B E E A->E
gum.config["notebook", "evidence_bgcolor"] = "green"
gum.config["notebook", "default_node_bgcolor"] = "yellow"
gum.config["notebook", "default_node_fgcolor"] = "red"
gnb.sideBySide(bn, gnb.getInference(bn, evs={"A": 1}, targets={"B"}))
G A A C C A->C B B A->B E E A->E D D D->C
structs Inference in   0.65ms D D C C D->C A A A->C B 2025-10-29T14:42:51.582119 image/svg+xml Matplotlib v3.10.7, A->B E E A->E
gum.config["notebook", "default_graph_size"] = 1
gnb.sideBySide(bn, gnb.getInference(bn, evs={"A": 1}, targets={"B"}))
G A A C C A->C B B A->B E E A->E D D D->C
structs Inference in   0.69ms D D C C D->C A A A->C B 2025-10-29T14:42:51.813468 image/svg+xml Matplotlib v3.10.7, A->B E E A->E
gum.config["notebook", "default_graph_inference_size"] = "1"
gnb.sideBySide(bn, gnb.getInference(bn, evs={"A": 1}, targets={"B"}))
G A A C C A->C B B A->B E E A->E D D D->C
structs Inference in   0.66ms D D C C D->C A A A->C B 2025-10-29T14:42:52.062348 image/svg+xml Matplotlib v3.10.7, A->B E E A->E
## find anything containing arc
gum.config.grep("arc")
[notebook]
default_arc_color = #4A4A4A
default_arc_cmap = BuGn
[influenceDiagram]
decision_arc_style = tapered, bold, dotted
utility_arc_style = dashed
[bnmixture]
default_arc_cmap = Greens
default_arc_color = #4A4A4A
default_arc_style = solid
correct_arc_style = solid
correct_arc_color = green
incorrect_arc_style = dashed
incorrect_arc_color = green
## find anything containing default
gum.config.grep("default")
[core]
default_maxnumberofthreads = 24
[notebook]
default_arc_color = #4A4A4A
default_node_bgcolor = yellow
default_node_fgcolor = red
default_node_cmap = Pastel1
default_arc_cmap = BuGn
default_edge_cmap = BuGn
default_graph_size = 1
default_graph_inference_size = 1
default_markovrandomfield_view = factorgraph
[factorgraph]
default_node_bgcolor = coral
default_node_fgcolor = black
default_factor_bgcolor = burlywood
[dynamicBN]
default_graph_size = 6
[influenceDiagram]
default_graph_size = 6
default_chance_bgcolor = #808080
default_chance_fgcolor = white
default_utility_bgcolor = #50508A
default_utility_fgcolor = white
default_decision_bgcolor = #9A5050
default_decision_fgcolor = white
default_id_size = 6
default_id_inference_size = 6
[credalnet]
default_node_bgcolor = #404040
default_node_fgcolor = white
[causal]
default_graph_size = 2.5
default_node_bgcolor = #404040
default_node_fgcolor = white
default_latent_bgcolor = #A08080
default_latent_fgcolor = black
[ctbn]
default_graph_size = 2.5
default_node_bgcolor = #404040
default_node_fgcolor = white
default_latent_bgcolor = #A08080
default_latent_fgcolor = black
[bnmixture]
default_graph_size = 5
default_line_size = 1.0
default_head_size = 0.25
default_arrow_type = normal
default_arc_cmap = Greens
default_arc_color = #4A4A4A
default_arc_style = solid
default_node_bgcolor = #404040
default_node_fgcolor = white
default_layout = fdp
default_overlap = 0
default_bar_capsize = 1.5
default_bar_height = 0.8
default_boot_histo_scale = 2.0
default_histo_scale = 1.0
## if a section contains the search, all its properties are shown
gum.config.grep("caus")
[causal]
show_latent_names = False
latex_do_prefix = \text{do}(
latex_do_suffix = )
default_graph_size = 2.5
default_node_bgcolor = #404040
default_node_fgcolor = white
default_latent_bgcolor = #A08080
default_latent_fgcolor = black

Saving current configuration in pyagrum.ini

Section titled “Saving current configuration in pyagrum.ini”
gum.config.reset() # back to defaults
gum.config["notebook", "default_arc_color"] = "#AAAAAA"
gum.config["notebook", "evidence_bgcolor"] = "green"
gum.config.save() # store curent changes
gum.config.reset() # back to defaults
gum.config.save() # store defaults back
from configparser import ConfigParser
c = ConfigParser()
gum.config["notebook", "default_arc_color"] = "#AAAAAA"
gum.config["notebook", "evidence_bgcolor"] = "green"
c.read_string(gum.config.__repr__())
print(c.sections())
['notebook']