Skip to content

Commit 4ade993

Browse files
committed
fix: don't exclude empty layout key in JSON output
1 parent 32efcb1 commit 4ade993

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/qualitative_networks.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ function QualitativeNetwork(bma_file_path::AbstractString)
458458
end
459459

460460
function JSON.json(qn::QualitativeNetwork)
461-
return JSON.json(qn_to_bma_dict(qn))
461+
return JSON.json(qn_to_bma_dict(qn); omit_empty = false)
462462
end
463463

464464
"""
@@ -759,17 +759,12 @@ Use `JSON.json(qn)` directly to convert to JSON.
759759
"""
760760
function qn_to_bma_dict(qn::QN{N,S,M}) where {N,S,C,G,L<:EntityIdName,M<:MetaGraph{C,G,L}}
761761
lower_upper = extrema.(get_domain(qn))
762-
# names_and_ids = rsplit.(string.(entities(qn)), ('_',); limit = 2)
763-
# id_to_name = Dict(parse(Int, id) .=> name for (name, id) in names_and_ids)
764-
# name_to_id = Dict(name .=> parse(Int, id) for (name, id) in names_and_ids)
765-
766-
767-
# fns = Dict(id_to_name[id] => fn for fn in target_functions(qn))
768762
ids = id.(entities(qn))
769763
entity_names = name.(entities(qn))
770764
functions = [target_functions(qn)[e] for e in entities(qn)]
771765
activator_inhibitor_pairs = classify_activators_inhibitors(target_functions(qn))
772766
functions = remove_ids_from_entities_in_target_fn.(functions)
767+
773768
variables = [
774769
Dict(
775770
"RangeFrom" => d[1],

0 commit comments

Comments
 (0)