Skip to content

Commit

Permalink
Updated README.md and simplified attributes map creation in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
yaricom committed Dec 11, 2023
1 parent c377cd7 commit e273fcd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ The new Graph can be added with associated attributes as following:

```GO
attributes := map[string]interface{}{
"default_weight": 1.1,
"acyclic": false,
"max_depth": 10,
"default_weight": 1.1,
"acyclic": false,
"max_depth": 10,
}

graph, err := gml.AddGraph("the graph", EdgeDirectionDirected, attributes)
Expand All @@ -98,9 +98,9 @@ The Node elements can be added to the Graph as following:

```GO
attributes := map[string]interface{}{
"X": 0.1,
"Y": 1.0,
"NodeNeuronType": network.InputNeuron,
"X": 0.1,
"Y": 1.0,
"NodeNeuronType": network.InputNeuron,
"NodeActivationType": network.NullActivation,
}

Expand All @@ -118,8 +118,8 @@ The Edge elements can be added to the Graph as following:

```GO
attributes := map[string]interface{}{
"weight": -1.1,
"sourceId": 1,
"weight": -1.1,
"sourceId": 1,
"targetId": 3,
}

Expand Down
9 changes: 5 additions & 4 deletions graphml/graphml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ func TestGraphML_Decode_keyTypeDefault(t *testing.T) {
require.NoError(t, err, "failed to decode")

// test results
attributes := make(map[string]interface{})
attributes["integer-key"] = 10
attributes["test-key"] = "test data"
attributes["color"] = "yellow"
attributes := map[string]interface{}{
"integer-key": 10,
"test-key": "test data",
"color": "yellow",
}

// check Graph element
//
Expand Down

0 comments on commit e273fcd

Please sign in to comment.