Skip to content

Commit

Permalink
Merge pull request #107 from george0st/transaction
Browse files Browse the repository at this point in the history
Add shell script and comments
  • Loading branch information
george0st authored Jan 1, 2024
2 parents 634caa1 + 02590de commit 95f4eef
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 9 deletions.
9 changes: 9 additions & 0 deletions cover.sh
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -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
10 changes: 4 additions & 6 deletions qgate_sln_mlrun/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={}
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -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()
Expand All @@ -178,16 +177,15 @@ 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()
server_version = run_db_factory._run_db.server_version
return server_version

def _memory(self):

"""Return size of memory"""
mem_total, mem_free = "", ""
with suppress(Exception):
import psutil
Expand Down
2 changes: 1 addition & 1 deletion qgate_sln_mlrun/ts/ts102.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion qgate_sln_mlrun/ts/ts201.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion qgate_sln_mlrun/ts/ts301.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions qgate_sln_mlrun/ts/ts502.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 95f4eef

Please sign in to comment.