vfWorks 0.0.1b1__tar.gz → 0.0.1.dev5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/PKG-INFO +1 -1
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/pyproject.toml +1 -1
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfWorks.egg-info/PKG-INFO +1 -1
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/metamodels/monitors.py +15 -20
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/metamodels/validity_frame.py +1 -128
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/package/PackageManager.py +2 -2
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/LICENSE +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/README.md +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/setup.cfg +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/setup.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfWorks.egg-info/SOURCES.txt +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfWorks.egg-info/dependency_links.txt +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfWorks.egg-info/entry_points.txt +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfWorks.egg-info/requires.txt +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfWorks.egg-info/top_level.txt +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/DSLs/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/DSLs/specificationModel/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/DSLs/specificationModel/grammar/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/DSLs/specificationModel/parser/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/DSLs/specificationModel/parser/parser.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/DSLs/specificationModel/templates/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/__main__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/clientLibraries/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/clientLibraries/vfclpy/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/clientLibraries/vfclpy/data_digest/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/clientLibraries/vfclpy/data_digest/digest.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/clientLibraries/vfclpy/data_forwarders/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/clientLibraries/vfclpy/data_forwarders/experiment.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/clientLibraries/vfclpy/data_platform.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/clientLibraries/vfclpy/probe.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/commands/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/commands/version.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/logging/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/logging/logger.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/metamodels/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/metamodels/common.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/metamodels/experiment.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/metamodels/knowledge_graph.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/metamodels/model_structure.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/metamodels/process.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/metamodels/properties.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/metamodels/specification.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/metamodels/standard.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/metamodels/torch_representation.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/package/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/transformations/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/transformations/transformations.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/utils/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/utils/auxiliary.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/utils/constants.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/utils/data/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/utils/data/dataLoader.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/utils/model/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/utils/model/modelLoader.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/workflows/__init__.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/workflows/executer.py +0 -0
- {vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/workflows/tasks.py +0 -0
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
# * vfWorks can not be copied and/or distributed without the express
|
|
7
7
|
# * permission of Bert Van Acker
|
|
8
8
|
# **************************************************************************************
|
|
9
|
-
from vfworks.metamodels.common import *
|
|
10
|
-
from vfworks.utils.constants import *
|
|
11
|
-
import importlib.util
|
|
12
|
-
import os
|
|
13
|
-
from pathlib import Path
|
|
9
|
+
from vfworks.metamodels.common import *
|
|
10
|
+
from vfworks.utils.constants import *
|
|
11
|
+
import importlib.util
|
|
12
|
+
import os
|
|
13
|
+
from pathlib import Path
|
|
14
14
|
|
|
15
15
|
class Monitor(baseElement):
|
|
16
16
|
|
|
@@ -46,11 +46,6 @@ class Monitor(baseElement):
|
|
|
46
46
|
"""Setup the monitor, including loading any custom validation hooks."""
|
|
47
47
|
self._load_custom_validation_hook(packageLocation=packageLocation)
|
|
48
48
|
|
|
49
|
-
def set_valid(self):
|
|
50
|
-
for observe in self.observes:
|
|
51
|
-
self.spec_status[observe.feature] = StatusType.VALID
|
|
52
|
-
self._status = StatusType.VALID
|
|
53
|
-
|
|
54
49
|
@property
|
|
55
50
|
def packageName(self):
|
|
56
51
|
return self._packageName
|
|
@@ -174,16 +169,16 @@ class Monitor(baseElement):
|
|
|
174
169
|
|
|
175
170
|
return global_is_valid
|
|
176
171
|
|
|
177
|
-
def _load_custom_validation_hook(self, packageLocation=None):
|
|
178
|
-
"""Private helper to locate and bind custom vector validation scripts."""
|
|
179
|
-
package_root = Path(os.getcwd()) if packageLocation is None else Path(packageLocation)
|
|
180
|
-
custom_script_path = package_root / "Resources" / "monitors" / f"{self._custom_code_file}"
|
|
181
|
-
|
|
182
|
-
# Check if the user wrote a custom plugin matching this monitor type
|
|
183
|
-
if custom_script_path.exists():
|
|
184
|
-
try:
|
|
185
|
-
# Load the file dynamically as a Python module
|
|
186
|
-
spec = importlib.util.spec_from_file_location(self.name, custom_script_path)
|
|
172
|
+
def _load_custom_validation_hook(self, packageLocation=None):
|
|
173
|
+
"""Private helper to locate and bind custom vector validation scripts."""
|
|
174
|
+
package_root = Path(os.getcwd()) if packageLocation is None else Path(packageLocation)
|
|
175
|
+
custom_script_path = package_root / "Resources" / "monitors" / f"{self._custom_code_file}"
|
|
176
|
+
|
|
177
|
+
# Check if the user wrote a custom plugin matching this monitor type
|
|
178
|
+
if custom_script_path.exists():
|
|
179
|
+
try:
|
|
180
|
+
# Load the file dynamically as a Python module
|
|
181
|
+
spec = importlib.util.spec_from_file_location(self.name, custom_script_path)
|
|
187
182
|
custom_module = importlib.util.module_from_spec(spec)
|
|
188
183
|
spec.loader.exec_module(custom_module)
|
|
189
184
|
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import os
|
|
10
10
|
import json
|
|
11
11
|
import logging
|
|
12
|
-
import re
|
|
13
12
|
from pathlib import Path
|
|
14
13
|
from vfworks.package.PackageManager import PackageManager
|
|
15
14
|
from vfworks.metamodels.knowledge_graph import KnowledgeGraph
|
|
@@ -19,7 +18,7 @@ from vfworks.metamodels.specification import *
|
|
|
19
18
|
from vfworks.metamodels.experiment import *
|
|
20
19
|
from vfworks.metamodels.properties import *
|
|
21
20
|
from vfworks.metamodels.common import *
|
|
22
|
-
from vfworks.utils.constants import StatusType
|
|
21
|
+
from vfworks.utils.constants import StatusType
|
|
23
22
|
from vfworks.logging.logger import *
|
|
24
23
|
from vfworks.utils.model.modelLoader import *
|
|
25
24
|
import networkx as nx
|
|
@@ -388,132 +387,6 @@ class ValidityFrame(baseElement):
|
|
|
388
387
|
with open(file_name, 'w') as f:
|
|
389
388
|
json.dump(graph_dict, f)
|
|
390
389
|
|
|
391
|
-
def architecture_graph(self):
|
|
392
|
-
"""
|
|
393
|
-
Build an architecture graph payload from the metadata and operational state.
|
|
394
|
-
"""
|
|
395
|
-
|
|
396
|
-
def humanize(name):
|
|
397
|
-
return re.sub(r'(?<!^)(?=[A-Z])', ' ', str(name)).strip()
|
|
398
|
-
|
|
399
|
-
def normalize(value):
|
|
400
|
-
return getattr(value, 'value', value)
|
|
401
|
-
|
|
402
|
-
model_structure = self.activeModelStructure
|
|
403
|
-
if model_structure is None and self.modelStructures:
|
|
404
|
-
model_structure = self.modelStructures[0]
|
|
405
|
-
|
|
406
|
-
if model_structure is None:
|
|
407
|
-
component = {
|
|
408
|
-
"id": self.GUID,
|
|
409
|
-
"name": self.name,
|
|
410
|
-
"inputs": [],
|
|
411
|
-
"outputs": [],
|
|
412
|
-
"ai_architecture": {
|
|
413
|
-
"pattern": "unknown",
|
|
414
|
-
"models": [],
|
|
415
|
-
"flow": []
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
else:
|
|
419
|
-
inputs = []
|
|
420
|
-
for inport in model_structure.inports:
|
|
421
|
-
input_entry = {
|
|
422
|
-
"id": f"input_{inport.name}",
|
|
423
|
-
"name": inport.name,
|
|
424
|
-
"datatype": normalize(inport.datatype),
|
|
425
|
-
"dimensions": None,
|
|
426
|
-
"shape": [],
|
|
427
|
-
"unit": None if normalize(inport.unit) in (None, "-", "UNIT_none") else normalize(inport.unit),
|
|
428
|
-
"description": inport.description
|
|
429
|
-
}
|
|
430
|
-
if "image" in inport.name.lower() or "image" in inport.description.lower():
|
|
431
|
-
input_entry["format"] = "image"
|
|
432
|
-
inputs.append(input_entry)
|
|
433
|
-
|
|
434
|
-
outputs = []
|
|
435
|
-
has_confidence_output = False
|
|
436
|
-
for outport in model_structure.outports:
|
|
437
|
-
output_entry = {
|
|
438
|
-
"id": f"output_{outport.name}",
|
|
439
|
-
"name": outport.name,
|
|
440
|
-
"datatype": normalize(outport.datatype),
|
|
441
|
-
"dimensions": None,
|
|
442
|
-
"shape": [],
|
|
443
|
-
"unit": None if normalize(outport.unit) in (None, "-", "UNIT_none") else normalize(outport.unit),
|
|
444
|
-
"description": outport.description
|
|
445
|
-
}
|
|
446
|
-
if outport.min != 0 or outport.max != 0:
|
|
447
|
-
output_entry["value_range"] = {"min": outport.min, "max": outport.max}
|
|
448
|
-
if outport.name.lower() == "confidence":
|
|
449
|
-
has_confidence_output = True
|
|
450
|
-
outputs.append(output_entry)
|
|
451
|
-
|
|
452
|
-
model_entry = {
|
|
453
|
-
"id": f"model_{model_structure.name}",
|
|
454
|
-
"name": humanize(model_structure.name),
|
|
455
|
-
"type": normalize(model_structure.modelType),
|
|
456
|
-
"reference": model_structure.modelRef
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
flow = []
|
|
460
|
-
for input_entry in inputs:
|
|
461
|
-
flow.append({"from": input_entry["id"], "to": model_entry["id"]})
|
|
462
|
-
for output_entry in outputs:
|
|
463
|
-
flow.append({"from": model_entry["id"], "to": output_entry["id"]})
|
|
464
|
-
|
|
465
|
-
component = {
|
|
466
|
-
"id": model_structure.name,
|
|
467
|
-
"name": humanize(model_structure.name),
|
|
468
|
-
"inputs": inputs,
|
|
469
|
-
"outputs": outputs,
|
|
470
|
-
"ai_architecture": {
|
|
471
|
-
"pattern": "single_model_with_confidence_output" if has_confidence_output else "single_model",
|
|
472
|
-
"models": [model_entry],
|
|
473
|
-
"flow": flow
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
monitors = []
|
|
478
|
-
default_target = model_structure.inports[0].name if model_structure and model_structure.inports else "model"
|
|
479
|
-
for monitor in self.runtime_monitors:
|
|
480
|
-
if monitor.type == MonitorTime.DATA_VALIDATION:
|
|
481
|
-
target = "dataset"
|
|
482
|
-
elif monitor.type == MonitorTime.MODEL_VALIDATION:
|
|
483
|
-
target = "model"
|
|
484
|
-
elif monitor.type == MonitorTime.RUN_TIME:
|
|
485
|
-
observed_features = [spec.feature for spec in (monitor.observes or [])]
|
|
486
|
-
if any("odd" in feature.lower() for feature in observed_features) or "odd" in monitor.name.lower() or "odd" in monitor.description.lower():
|
|
487
|
-
target = "environment"
|
|
488
|
-
else:
|
|
489
|
-
target = default_target
|
|
490
|
-
else:
|
|
491
|
-
target = default_target
|
|
492
|
-
|
|
493
|
-
monitors.append({
|
|
494
|
-
"name": monitor.name,
|
|
495
|
-
"target": target,
|
|
496
|
-
"description": monitor.description,
|
|
497
|
-
"observes": [spec.feature for spec in (monitor.observes or [])]
|
|
498
|
-
})
|
|
499
|
-
|
|
500
|
-
return {
|
|
501
|
-
"component": component,
|
|
502
|
-
"monitors": monitors
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
def export_architecture_json(self, file_name="architecture.json"):
|
|
506
|
-
"""
|
|
507
|
-
Export the architecture graph payload to a JSON file.
|
|
508
|
-
"""
|
|
509
|
-
architecture = self.architecture_graph()
|
|
510
|
-
output_path = Path(file_name)
|
|
511
|
-
if not output_path.is_absolute():
|
|
512
|
-
output_path = self.package_manager.package_root / output_path
|
|
513
|
-
|
|
514
|
-
with open(output_path, 'w', encoding='utf-8') as f:
|
|
515
|
-
json.dump(architecture, f, indent=2)
|
|
516
|
-
|
|
517
390
|
# ------------------------------------------------------------------------------------------------------------------
|
|
518
391
|
# IMPORT/EXPORT FUNCTIONS
|
|
519
392
|
# -----------------------------------------------------------------------------------------------------------------
|
|
@@ -179,7 +179,7 @@ class PackageManager(object):
|
|
|
179
179
|
for folder in ["loaders", "monitors"]:
|
|
180
180
|
self._mkdir_custom(package_path/ "Resources" / folder, file="readme.rst")
|
|
181
181
|
|
|
182
|
-
self._addFile(file="
|
|
182
|
+
self._addFile(file="testType.py", path=package_path / "Resources" / "loaders")
|
|
183
183
|
self._addFile(file="custom_monitor_example.py", path=package_path / "Resources" / "monitors")
|
|
184
184
|
|
|
185
185
|
self._write_config(package_path, config or self.default_config(package_path))
|
|
@@ -219,7 +219,7 @@ class PackageManager(object):
|
|
|
219
219
|
)
|
|
220
220
|
elif "config.yaml" in file:
|
|
221
221
|
content = yaml.safe_dump(self.default_config(target_dir.parent), sort_keys=False)
|
|
222
|
-
elif file == "
|
|
222
|
+
elif file == "testType.py":
|
|
223
223
|
content = (
|
|
224
224
|
'"""Template for Custom Model Loaders\n'
|
|
225
225
|
"\n"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/DSLs/specificationModel/templates/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/clientLibraries/vfclpy/data_digest/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/clientLibraries/vfclpy/data_forwarders/__init__.py
RENAMED
|
File without changes
|
{vfworks-0.0.1b1 → vfworks-0.0.1.dev5}/vfworks/clientLibraries/vfclpy/data_forwarders/experiment.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|