deriva-ml 1.14.26__tar.gz → 1.14.27__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.
Files changed (106) hide show
  1. {deriva_ml-1.14.26/src/deriva_ml.egg-info → deriva_ml-1.14.27}/PKG-INFO +1 -1
  2. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/dataset/dataset.py +2 -1
  3. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/execution/workflow.py +8 -8
  4. {deriva_ml-1.14.26 → deriva_ml-1.14.27/src/deriva_ml.egg-info}/PKG-INFO +1 -1
  5. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml.egg-info/SOURCES.txt +2 -0
  6. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/execution/test_execution.py +55 -0
  7. deriva_ml-1.14.27/tests/execution/workflow-script.py +19 -0
  8. deriva_ml-1.14.27/tests/execution/workflow_test.ipynb +94 -0
  9. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/.github/release-drafter.yml +0 -0
  10. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/.github/workflows/publish-docs.yml +0 -0
  11. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/.github/workflows/release.yml +0 -0
  12. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/.gitignore +0 -0
  13. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/LICENSE +0 -0
  14. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/README.md +0 -0
  15. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/.DS_Store +0 -0
  16. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/Notebooks/DerivaML Create Notes.ipynb +0 -0
  17. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/Notebooks/DerivaML Dataset.ipynb +0 -0
  18. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/Notebooks/DerivaML Execution.ipynb +0 -0
  19. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/Notebooks/DerivaML Features.ipynb +0 -0
  20. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/Notebooks/DerivaML Ingest.ipynb +0 -0
  21. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/Notebooks/DerivaML Vocabulary.ipynb +0 -0
  22. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/assets/ERD.png +0 -0
  23. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/assets/Launcher.png +0 -0
  24. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/assets/copy_minid.png +0 -0
  25. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/assets/deriva-logo.png +0 -0
  26. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/assets/deriva-ml.pdf +0 -0
  27. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/assets/sharing-at-home.pdf +0 -0
  28. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/code-docs/dataset.md +0 -0
  29. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/code-docs/dataset_aux_classes.md +0 -0
  30. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/code-docs/dataset_bag.md +0 -0
  31. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/code-docs/deriva_definitions.md +0 -0
  32. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/code-docs/deriva_ml_base.md +0 -0
  33. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/code-docs/deriva_model.md +0 -0
  34. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/code-docs/execution.md +0 -0
  35. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/code-docs/execution_configuration.md +0 -0
  36. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/code-docs/feature.md +0 -0
  37. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/code-docs/upload.md +0 -0
  38. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/index.md +0 -0
  39. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/release-notes.md +0 -0
  40. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/user-guide/datasets.md +0 -0
  41. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/user-guide/deriva_ml_structure.md +0 -0
  42. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/user-guide/execution-configuration.md +0 -0
  43. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/user-guide/file-assets.md +0 -0
  44. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/user-guide/identifiers.md +0 -0
  45. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/user-guide/install.md +0 -0
  46. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/user-guide/notebooks.md +0 -0
  47. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/docs/user-guide/overview.md +0 -0
  48. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/mkdocs.yml +0 -0
  49. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/pyproject.toml +0 -0
  50. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/release.sh +0 -0
  51. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/setup.cfg +0 -0
  52. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/__init__.py +0 -0
  53. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/core/__init__.py +0 -0
  54. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/core/base.py +0 -0
  55. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/core/constants.py +0 -0
  56. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/core/definitions.py +0 -0
  57. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/core/enums.py +0 -0
  58. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/core/ermrest.py +0 -0
  59. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/core/exceptions.py +0 -0
  60. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/core/filespec.py +0 -0
  61. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/dataset/__init__.py +0 -0
  62. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/dataset/aux_classes.py +0 -0
  63. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/dataset/dataset_bag.py +0 -0
  64. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/dataset/history.py +0 -0
  65. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/dataset/upload.py +0 -0
  66. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/demo_catalog.py +0 -0
  67. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/execution/__init__.py +0 -0
  68. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/execution/environment.py +0 -0
  69. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/execution/execution.py +0 -0
  70. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/execution/execution_configuration.py +0 -0
  71. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/feature.py +0 -0
  72. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/model/__init__.py +0 -0
  73. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/model/catalog.py +0 -0
  74. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/model/database.py +0 -0
  75. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/model/sql_mapper.py +0 -0
  76. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/run_notebook.py +0 -0
  77. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/schema/__init__.py +0 -0
  78. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/schema/annotations.py +0 -0
  79. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/schema/check_schema.py +0 -0
  80. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/schema/create_schema.py +0 -0
  81. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/schema/deriva-ml-reference.json +0 -0
  82. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/schema/policy.json +0 -0
  83. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml/schema/table_comments_utils.py +0 -0
  84. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml.egg-info/dependency_links.txt +0 -0
  85. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml.egg-info/entry_points.txt +0 -0
  86. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml.egg-info/requires.txt +0 -0
  87. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/src/deriva_ml.egg-info/top_level.txt +0 -0
  88. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/__init__.py +0 -0
  89. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/conftest.py +0 -0
  90. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/core/__init__.py +0 -0
  91. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/core/test_basic_tables.py +0 -0
  92. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/core/test_file.py +0 -0
  93. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/core/test_vocabulary.py +0 -0
  94. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/dataset/__init__.py +0 -0
  95. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/dataset/test_dataset_version.py +0 -0
  96. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/dataset/test_datasets.py +0 -0
  97. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/dataset/test_download.py +0 -0
  98. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/execution/__init__.py +0 -0
  99. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/feature/test_features.py +0 -0
  100. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/model/__init__.py +0 -0
  101. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/model/test_database.py +0 -0
  102. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/model/test_models.py +0 -0
  103. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/test-files/execution-parameters.json +0 -0
  104. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/test-files/notebook-parameters.json +0 -0
  105. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/tests/test_utils.py +0 -0
  106. {deriva_ml-1.14.26 → deriva_ml-1.14.27}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deriva-ml
3
- Version: 1.14.26
3
+ Version: 1.14.27
4
4
  Summary: Utilities to simplify use of Dervia and Pandas to create reproducable ML pipelines
5
5
  Author-email: ISRD <isrd-dev@isi.edu>
6
6
  Requires-Python: >=3.10
@@ -211,6 +211,7 @@ class Dataset:
211
211
  dataset_path.update([{"RID": dataset, "Version": version["RID"]} for dataset, version in versions.items()])
212
212
 
213
213
  def _set_version_snapshot(self):
214
+ """Update the Snapshot column of the Dataset_Version table to the correct time."""
214
215
  dataset_version_path = self._model.catalog.getPathBuilder().schemas[self._ml_schema].tables["Dataset_Version"]
215
216
  versions = dataset_version_path.entities().fetch()
216
217
  dataset_version_path.update(
@@ -1023,7 +1024,7 @@ class Dataset:
1023
1024
  self._logger.info(
1024
1025
  "Downloading dataset %s for catalog: %s@%s"
1025
1026
  % (
1026
- 'minid' if self._use_minid else 'bag',
1027
+ "minid" if self._use_minid else "bag",
1027
1028
  dataset.rid,
1028
1029
  str(dataset.version),
1029
1030
  )
@@ -305,14 +305,14 @@ class Workflow(BaseModel):
305
305
  is_notebook = False
306
306
  stack = inspect.stack()
307
307
  # Get the caller's filename, which is two up the stack from here.
308
- if len(stack) > 1:
309
- filename = Path(stack[2].filename)
310
- if not filename.exists():
311
- # Being called from the command line interpreter.
312
- filename = Path("REPL")
313
- # Get the caller's filename, which is two up the stack from here.
314
- else:
315
- raise DerivaMLException("Looking for caller failed") # Stack is too shallow
308
+
309
+ filename = Path(stack[-1].filename)
310
+ if not filename.exists():
311
+ # Being called from the command line interpreter.
312
+ filename = Path("REPL")
313
+ # Get the caller's filename, which is two up the stack from here.
314
+ else:
315
+ raise DerivaMLException("Looking for caller failed") # Stack is too shallow
316
316
  return filename, is_notebook
317
317
 
318
318
  @staticmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deriva-ml
3
- Version: 1.14.26
3
+ Version: 1.14.27
4
4
  Summary: Utilities to simplify use of Dervia and Pandas to create reproducable ML pipelines
5
5
  Author-email: ISRD <isrd-dev@isi.edu>
6
6
  Requires-Python: >=3.10
@@ -94,6 +94,8 @@ tests/dataset/test_datasets.py
94
94
  tests/dataset/test_download.py
95
95
  tests/execution/__init__.py
96
96
  tests/execution/test_execution.py
97
+ tests/execution/workflow-script.py
98
+ tests/execution/workflow_test.ipynb
97
99
  tests/feature/test_features.py
98
100
  tests/model/__init__.py
99
101
  tests/model/test_database.py
@@ -2,6 +2,8 @@
2
2
  Tests for the execution module.
3
3
  """
4
4
 
5
+ import re
6
+ import subprocess
5
7
  from tempfile import TemporaryDirectory
6
8
 
7
9
  from deriva_ml import (
@@ -16,6 +18,59 @@ from deriva_ml import (
16
18
  )
17
19
 
18
20
 
21
+ class TestWorkflow:
22
+ def test_workflow_creation_script(self, test_ml):
23
+ ml_instance = test_ml
24
+ ml_instance.add_term(vc.asset_type, "Test Model", description="Model for our Test workflow")
25
+ ml_instance.add_term(vc.workflow_type, "Test Workflow", description="A ML Workflow that uses Deriva ML API")
26
+ print("Running workflow-script.py ...")
27
+ result = subprocess.run(
28
+ [
29
+ "python",
30
+ "execution/workflow-script.py",
31
+ ml_instance.catalog.deriva_server.server,
32
+ ml_instance.catalog_id,
33
+ ],
34
+ capture_output=True,
35
+ text=True,
36
+ )
37
+ print(result.stdout)
38
+ m = re.match(".*url='(?P<url>.*?)'", result.stdout)
39
+ url = m["url"]
40
+ m = re.match(".*checksum='(?P<checksum>.*?)'", result.stdout)
41
+ checksum = m["checksum"]
42
+ m = re.match(".*is_notebook=(?P<is_notebook>True|False)", result.stdout)
43
+ is_notebook = m["is_notebook"]
44
+ print("URL", url)
45
+ print("checksum", checksum)
46
+ print("is_notebook", is_notebook)
47
+ assert is_notebook == "False"
48
+ assert url.endswith("workflow-script.py")
49
+
50
+ def test_workflow_creation_notebook(self, test_ml):
51
+ ml_instance = test_ml
52
+ ml_instance.add_term(vc.asset_type, "Test Model", description="Model for our Test workflow")
53
+ ml_instance.add_term(vc.workflow_type, "Test Workflow", description="A ML Workflow that uses Deriva ML API")
54
+ print("Running workflow-script.py ...")
55
+ result = subprocess.run(
56
+ ["runnotebook", "execution/workflow-script.ipnb", "localhost", ml_instance.catalog_id],
57
+ capture_output=True,
58
+ text=True,
59
+ )
60
+ print(result.stdout)
61
+ m = re.match(".*url='(?P<url>.*?)'", result.stdout)
62
+ url = m["url"]
63
+ m = re.match(".*checksum='(?P<checksum>.*?)'", result.stdout)
64
+ checksum = m["checksum"]
65
+ m = re.match(".*is_notebook=(?P<is_notebook>True|False)", result.stdout)
66
+ is_notebook = m["is_notebook"]
67
+ print("URL", url)
68
+ print("checksum", checksum)
69
+ print("is_notebook", is_notebook)
70
+ assert is_notebook == "False"
71
+ assert url.endswith("workflow-script.py")
72
+
73
+
19
74
  class TestExecution:
20
75
  def test_execution_no_download(self, test_ml):
21
76
  ml_instance = test_ml
@@ -0,0 +1,19 @@
1
+ import sys
2
+
3
+ from deriva_ml import DerivaML
4
+ from deriva_ml import MLVocab as vc
5
+
6
+ hostname = sys.argv[1]
7
+ catalog_id = sys.argv[2]
8
+
9
+
10
+ ml_instance = DerivaML(hostname, catalog_id)
11
+
12
+ ml_instance.add_term(vc.asset_type, "Test Model", description="Model for our Test workflow")
13
+ ml_instance.add_term(vc.workflow_type, "Test Workflow", description="A ML Workflow that uses Deriva ML API")
14
+ api_workflow = ml_instance.create_workflow(
15
+ name="Test Workflow One",
16
+ workflow_type="Test Workflow",
17
+ description="A test operation",
18
+ )
19
+ print(api_workflow)
@@ -0,0 +1,94 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "0",
6
+ "metadata": {},
7
+ "source": [
8
+ "# Notebook template for executing code using DerivaML.\n",
9
+ "\n",
10
+ "This notebook should be modified to perform the desired calcuation and *COMITTED* to Gihub prior to execution."
11
+ ]
12
+ },
13
+ {
14
+ "metadata": {
15
+ "ExecuteTime": {
16
+ "end_time": "2025-04-18T20:05:17.505817Z",
17
+ "start_time": "2025-04-18T20:05:16.235245Z"
18
+ }
19
+ },
20
+ "cell_type": "code",
21
+ "source": [
22
+ "from deriva_ml import DerivaML, MLVocab as vc\n",
23
+ "import os"
24
+ ],
25
+ "id": "2c6cbcfe94814682",
26
+ "outputs": [],
27
+ "execution_count": 1
28
+ },
29
+ {
30
+ "metadata": {},
31
+ "cell_type": "markdown",
32
+ "source": "## Parameters cell\n",
33
+ "id": "2af30ff79278ba00"
34
+ },
35
+ {
36
+ "metadata": {
37
+ "tags": [
38
+ "parameters"
39
+ ]
40
+ },
41
+ "cell_type": "code",
42
+ "outputs": [],
43
+ "execution_count": null,
44
+ "source": [
45
+ "hostname = None\n",
46
+ "catalog_id = None"
47
+ ],
48
+ "id": "3"
49
+ },
50
+ {
51
+ "metadata": {},
52
+ "cell_type": "code",
53
+ "outputs": [],
54
+ "execution_count": null,
55
+ "source": [
56
+ "# Modify these to your desired server and catalog.\n",
57
+ "hostname = hostname or os.environ.get(\"DERIVA_HOST\")\n",
58
+ "catalog_id = catalog_id or os.environ.get(\"DERIVA_CATALOG_ID\")\n",
59
+ "\n",
60
+ "# Change this line to call the domain specific class derived from DerivaML\n",
61
+ "deriva_ml = DerivaML(hostname=hostname, catalog_id=catalog_id)\n",
62
+ "deriva_ml.add_term(vc.asset_type, \"Test Model\", description=\"Model for our Test workflow\")\n",
63
+ "deriva_ml.add_term(vc.workflow_type, \"Test Workflow\", description=\"A ML Workflow that uses Deriva ML API\")\n",
64
+ "api_workflow = deriva_ml.create_workflow(\n",
65
+ " name=\"Test Workflow One\",\n",
66
+ " workflow_type=\"Test Workflow\",\n",
67
+ " description=\"A test operation\",\n",
68
+ ")\n"
69
+ ],
70
+ "id": "1"
71
+ }
72
+ ],
73
+ "metadata": {
74
+ "kernelspec": {
75
+ "display_name": "deriva-test",
76
+ "language": "python",
77
+ "name": "deriva-test"
78
+ },
79
+ "language_info": {
80
+ "codemirror_mode": {
81
+ "name": "ipython",
82
+ "version": 2
83
+ },
84
+ "file_extension": ".py",
85
+ "mimetype": "text/x-python",
86
+ "name": "python",
87
+ "nbconvert_exporter": "python",
88
+ "pygments_lexer": "ipython2",
89
+ "version": "2.7.6"
90
+ }
91
+ },
92
+ "nbformat": 4,
93
+ "nbformat_minor": 5
94
+ }
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