Skip to content

Commit

Permalink
Add filter_by example
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbette committed Apr 5, 2024
1 parent 7e2b0ec commit e3eb1af
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
Binary file added doc/filter-THROUGHPUT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion npf/grapher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1713,13 +1713,14 @@ def generate_plot_for_graph(self, i, i_subplot, figure, n_cols, n_lines, vars_va
if type(ncol) == list:
ncol = ncol[ilegend % len(ncol)]
doleg = self.config_bool_or_in('graph_legend', result_type)

if doleg is None:
if len(labels) == 1 and labels[0] in ('local','version'):
doleg = False
print("Legend not shown as there is only one serie with a default name. Set --config graph_legend=1 to force printing a legend.")
else:
doleg = True
if default_doleg or doleg:
if (default_doleg or doleg) and doleg is not False:
loc = self.config("legend_loc")
if type(loc) is dict or type(loc) is list:
loc = self.scriptconfig("legend_loc",key="result",result_type=result_type)
Expand Down
4 changes: 4 additions & 0 deletions npf/section.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ast

from typing import List, Set
from collections.abc import Mapping

from npf import npf
from npf.repository import Repository
Expand Down Expand Up @@ -732,6 +733,9 @@ def get_dict_value(self, var, key, result_type=None, default=None):
best_l = -1
best = default
if var in self:
if not isinstance(self.vlist[var], DictVariable) and self.vlist[var]:
return self[var]

d = self.get_dict(var)
if result_type is not None:
#Search for "key-result_type", such as result-throughput
Expand Down
2 changes: 1 addition & 1 deletion npf/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.55"
__version__ = "1.0.56"

0 comments on commit e3eb1af

Please sign in to comment.