diff --git a/cover.sh b/cover.sh new file mode 100644 index 00000000..a5ebb5fd --- /dev/null +++ b/cover.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# Setting based on 'https://coverage.readthedocs.io/en/7.3.2/' + +coverage erase +coverage run -m unittest discover +coverage combine +coverage report -m +coverage-badge -f -o coverage.svg \ No newline at end of file diff --git a/publish.sh b/publish.sh new file mode 100644 index 00000000..3899c4ff --- /dev/null +++ b/publish.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# pip install --upgrade build +# pip install --upgrade twine + +rmdir /S /Q dist +rmdir /S /Q build +rmdir /S /Q qgate_sln_mlrun.egg-info + +# helper 'https://www.scivision.dev/python-minimal-package/' +# https://pypa-build.readthedocs.io/en/latest/ +python -m build --wheel + +# twine upload is supported +twine upload dist/* --verbose -u__token__ + +rmdir /S /Q dist +rmdir /S /Q build +rmdir /S /Q qgate_sln_mlrun.egg-info diff --git a/qgate_sln_mlrun/output.py b/qgate_sln_mlrun/output.py index a3d92f6d..a8e6dcc3 100644 --- a/qgate_sln_mlrun/output.py +++ b/qgate_sln_mlrun/output.py @@ -30,7 +30,7 @@ def __init__(self, setup: Setup, templates: [str]=[DEFAULT_TEMPLATE_HTML, Initial :param setup: specific usecase - :param templates: list of templates for generation outputs + :param templates: list of templates for generation outputs (support templetes as file of embeded templates) """ self._setup=setup self._data={} @@ -78,6 +78,7 @@ def testcase_state(self, state="DONE"): # endregion def render(self): + """Generate/Render final outputs basen on templates""" # https://zetcode.com/python/jinja/ # https://ultraconfig.com.au/blog/jinja2-a-crash-course-for-beginners/ # https://www.analyticsvidhya.com/blog/2022/04/the-ultimate-guide-to-master-jinja-template/ @@ -154,8 +155,6 @@ def _summary(self): self._data["summary"]["count_testcases_err"]=count_testcases-count_testcases_done self._data["summary"]["first_errors"]=first_errors - - def _system_info(self): self._data["version"] = __version__ self._data["model_version"] = self._get_model_version() @@ -178,8 +177,7 @@ def _get_model_version(self): return TSBase.get_model_info(self._setup.model_definition) def _mlrun_server(self): - # Return server MLRun version - + """Return server MLRun version""" server_version="" with suppress(Exception): run_db_factory = mlrun.db.factory.RunDBFactory() @@ -187,7 +185,7 @@ def _mlrun_server(self): return server_version def _memory(self): - + """Return size of memory""" mem_total, mem_free = "", "" with suppress(Exception): import psutil diff --git a/qgate_sln_mlrun/ts/ts102.py b/qgate_sln_mlrun/ts/ts102.py index 144121ce..a5c2e17a 100644 --- a/qgate_sln_mlrun/ts/ts102.py +++ b/qgate_sln_mlrun/ts/ts102.py @@ -21,7 +21,7 @@ def desc(self) -> str: @property def long_desc(self): - return "Delete project include all contents and targets (such as Parquet files, etc.)" + return "Delete project include all contents and targets (such as Parquet/CSV files, etc.)" def exec(self): self.delete_projects() diff --git a/qgate_sln_mlrun/ts/ts201.py b/qgate_sln_mlrun/ts/ts201.py index b3f0be25..d4401ef0 100644 --- a/qgate_sln_mlrun/ts/ts201.py +++ b/qgate_sln_mlrun/ts/ts201.py @@ -26,7 +26,8 @@ def desc(self) -> str: @property def long_desc(self): - return "Create feature set with name, description, entities, features and targets" + return ("Create feature set with name, description, entities, features and targets. " + "Supported targes are these off-line 'parquet', 'csv' and the on-line 'redis'.") def exec(self): self.create_featuresets() diff --git a/qgate_sln_mlrun/ts/ts301.py b/qgate_sln_mlrun/ts/ts301.py index 31ade629..1e8a5136 100644 --- a/qgate_sln_mlrun/ts/ts301.py +++ b/qgate_sln_mlrun/ts/ts301.py @@ -23,7 +23,7 @@ def desc(self) -> str: @property def long_desc(self): - return "Ingest data to feature set from data source to targets based on feature set definition" + return "Ingest data to feature set(s) from data source" def exec(self): self.ingest_data() diff --git a/qgate_sln_mlrun/ts/ts502.py b/qgate_sln_mlrun/ts/ts502.py index b09bb4a0..826eba88 100644 --- a/qgate_sln_mlrun/ts/ts502.py +++ b/qgate_sln_mlrun/ts/ts502.py @@ -46,6 +46,7 @@ def _get_data_online(self, testcase_name, project_name, featurevector_name): vector = fstore.get_feature_vector(f"{project_name}/{featurevector_name}") with fstore.get_online_feature_service(vector) as svc: + # TODO add valid party-id from data entities = [{"party-id": "d68fe603-7cb1-44e4-9013-7330a050a6be"}] resp=svc.get(entities, as_list=True)