Skip to content

Commit

Permalink
Graphfixes (#84)
Browse files Browse the repository at this point in the history
* If we have a a line graph, we need to make sure the data values are sorted by x.
but we still want to sort the categories, so we explicitly pull out the possible categories
to make sure they are sorted.

Signed-off-by: [email protected] <[email protected]>

* We should use the FFMPEG_BIN environment variable if its defined.

Signed-off-by: [email protected] <[email protected]>

---------

Signed-off-by: [email protected] <[email protected]>
Co-authored-by: [email protected] <[email protected]>
  • Loading branch information
richardssam and SamRichardsDisney authored Feb 25, 2024
1 parent 8d5ea2e commit 5c67c97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion enctests/testframework/encoders/ffmpeg_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def run_wedges(self) -> dict:

def get_application_version(self) -> str:
if not self._application_version:
cmd = f'ffmpeg -version -v quiet -hide_banner'
cmd = f'{FFMPEG_BIN} -version -v quiet -hide_banner'
_raw = subprocess.check_output(shlex.split(cmd))
version = b'_'.join(_raw.split(b' ')[:3])

Expand Down
11 changes: 10 additions & 1 deletion enctests/testframework/utils/outputTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@ def _exportGraph(config, reportconfig, graph, alltests):
else:
df = pd.DataFrame(alltests)
# This sorts the filenames.
df = df.sort_values(by=graph.get("sortby", "name"))
if graph.get("type", "line") == "bar":
df = df.sort_values(by=graph.get("sortby", "name"))
fig = px.bar(df, **graphargs)
else:
# If we have a a line graph, we need to make sure the data values are sorted by x.
# but we still want to sort the categories, so we explicitly pull out the possible categories
# to make sure they are sorted.
df = df.sort_values(by=graphargs.get("x"))
labels = {}
for test in alltests:
labels[test[graphargs['color']]] = test[graphargs['color']]
category_orders = {graphargs['color']: labels.keys()}
graphargs['category_orders'] = category_orders
fig = px.line(df, **graphargs)

filename = Path(reportconfig['name']+"-"+graph.get("name"))
Expand Down

0 comments on commit 5c67c97

Please sign in to comment.