Skip to content

Commit

Permalink
Merge branch 'bugfix/env_var_and_report_bug' into 'master'
Browse files Browse the repository at this point in the history
Bugfix/env var and report bug

See merge request caimira/caimira!488
  • Loading branch information
lrdossan committed Mar 11, 2024
2 parents 10ce133 + 62024a2 commit f8f4b2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion caimira/apps/calculator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def make_app(
'filename': 'userguide.html.j2'}),
]

profiler_enabled = os.environ.get('CAIMIRA_PROFILER_ENABLED', 0)
profiler_enabled = int(os.environ.get('CAIMIRA_PROFILER_ENABLED', 0))
if profiler_enabled:
urls += [
(get_root_url(CaimiraProfiler.ROOT_URL), ProfilerPage),
Expand Down
4 changes: 2 additions & 2 deletions caimira/apps/calculator/report_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ def non_zero_percentage(percentage: int) -> str:
return "<0.01%"
elif percentage < 1:
return "{:0.2f}%".format(percentage)
elif np.isnan(percentage):
return "99.9%"
elif percentage > 99.9 or np.isnan(percentage):
return ">99.9%"
else:
return "{:0.1f}%".format(percentage)

Expand Down

0 comments on commit f8f4b2a

Please sign in to comment.