Skip to content

Commit

Permalink
Merge pull request #290 from george0st/change
Browse files Browse the repository at this point in the history
Tune output templates
  • Loading branch information
george0st authored Apr 19, 2024
2 parents 291f0ec + 8eb2cf9 commit a8573c9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion qgate_sln_mlrun/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ def _summary(self):
def _system_info(self):
self._data["version"] = __version__
self._data["model_version"] = self._get_model_version()
self._data["used_filters"] = "limited" if self._setup.used_filters else "full"

# application anonymous mode setting
time_format='%Y-%m-%d 9%H%M%S%f' if self._setup.anonym_mode else '%Y-%m-%d %H:%M:%S'
time_format='%Y-%m-%d x9%H%M%S%f' if self._setup.anonym_mode else '%Y-%m-%d %H:%M:%S'
self._data["datetime"] = datetime.datetime.now().strftime(time_format)

self._data["memory_total"], self._data["memory_free"] = self._memory()
Expand Down
11 changes: 11 additions & 0 deletions qgate_sln_mlrun/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ def variables(self):
variable_list.append(itm)
return variable_list

@property
def used_filters(self):
"""Check, if some filter is used"""
if self.filter_scenarios:
if len(self.filter_scenarios)>0:
return True
if self.filter_projects:
if len(self.filter_projects)>0:
return True
return False

@property
def model_output(self):
"""Return the model output path"""
Expand Down
7 changes: 4 additions & 3 deletions qgate_sln_mlrun/templates/qgt-mlrun.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@

</script>
<body>
<h2>Quality report for MLRun</h2>
<p><b>{{ data.datetime }}</b>, QGate version/model: v{{ data.version }}/v{{ data.model_version }}</p>
<h2>Quality report for <u>MLRun {{ data.mlrun_server }}</u></h2>
<p>Report ID: <b>{{ data.datetime }}</b> ({{ data.used_filters }})</p>

<button type="button" class="collapsible" {% if data.summary.state == 'DONE' %}style="background-color: green;"{% else %}style="background-color: #E20074;"{% endif %} onclick="myFunction('myDIV3','myFiltr')">
<table style="border: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 18px;">
Expand Down Expand Up @@ -199,8 +199,9 @@ <h2>Quality report for MLRun</h2>
<div id="myDIV" style="display: none;" class="content-tiny">
<p>
<b>System information:</b><br>
&nbsp;&nbsp;<b style="color:blue;">MLRun (client/server): {{ data.mlrun }}/{{ data.mlrun_server }}</b> (<a href="https://docs.mlrun.org/en/latest/change-log/index.html" target="_blank">MLRun change log</a>)<br>
&nbsp;&nbsp;<b style="color:blue;">MLRun: {{ data.mlrun }} (client)/{{ data.mlrun_server }} (server)</b>, <a href="https://docs.mlrun.org/en/latest/change-log/index.html" target="_blank">MLRun change log</a><br>
&nbsp;&nbsp;<b style="color:blue;">Python: {{ data.python }}</b><br>
&nbsp;&nbsp;<b style="color:blue;">QGate: {{ data.version }} (version)/{{ data.model_version }} (model)</b><br>
&nbsp;&nbsp;<b>System:</b> {{ data.system }}<br>
&nbsp;&nbsp;<b>Platform:</b> {{ data.platform }}<br>
</p>
Expand Down
7 changes: 4 additions & 3 deletions qgate_sln_mlrun/templates/qgt-mlrun.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# QGate version/model: v{{ data.version }}/v{{ data.model_version }}
# {{ data.datetime }}
# Quality report for MLRun {{ data.mlrun_server }}
# Report ID: {{ data.datetime }} ({{ data.used_filters }})
# -----------------------
Summary, test scenarios: {{ data.summary.count_testcases }} [TOTAL] ({{ data.summary.count_testcases_err }}/{{ data.summary.count_testcases_done }} [ERR/DONE])
# -----------------------{% for testscenario in data.testscenarios %}
{{ testscenario.name }}: {{ testscenario.desc }}{% for testcase in testscenario.testcases %}
{% if testcase.state == 'DONE' %}{{ testcase.state }} {% else %}{{ testcase.state }} {% endif %}... {{ testcase.name }}{% if testcase.detail is not none %}: {{ testcase.detail }}{% endif %}{% endfor %}{% endfor %}
# -----------------------
# MLRun (client/server): {{ data.mlrun }}/{{ data.mlrun_server }} (https://docs.mlrun.org/en/latest/change-log/index.html)
# MLRun: {{ data.mlrun }} (client)/{{ data.mlrun_server }} (server), see https://docs.mlrun.org/en/latest/change-log/index.html
# Python: {{ data.python }}
# QGate: {{ data.version }} (version)/{{ data.model_version }} (model)
# System: {{ data.system }}
# Platform: {{ data.platform }}
# ----------------------- {% for variable in data.variables %}
Expand Down

0 comments on commit a8573c9

Please sign in to comment.