deriva-ml 1.14.36__tar.gz → 1.14.37__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 (111) hide show
  1. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/PKG-INFO +1 -1
  2. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/execution/execution.py +9 -3
  3. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/execution/workflow.py +3 -4
  4. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/install_kernel.py +32 -6
  5. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/schema/create_schema.py +1 -1
  6. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml.egg-info/PKG-INFO +1 -1
  7. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/conftest.py +2 -1
  8. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/execution/test_execution.py +4 -1
  9. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/test_utils.py +1 -1
  10. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/.github/release-drafter.yml +0 -0
  11. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/.github/workflows/publish-docs.yml +0 -0
  12. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/.github/workflows/release.yml +0 -0
  13. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/.gitignore +0 -0
  14. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/LICENSE +0 -0
  15. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/README.md +0 -0
  16. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/.DS_Store +0 -0
  17. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/Notebooks/DerivaML Create Notes.ipynb +0 -0
  18. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/Notebooks/DerivaML Dataset.ipynb +0 -0
  19. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/Notebooks/DerivaML Execution.ipynb +0 -0
  20. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/Notebooks/DerivaML Features.ipynb +0 -0
  21. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/Notebooks/DerivaML Ingest.ipynb +0 -0
  22. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/Notebooks/DerivaML Vocabulary.ipynb +0 -0
  23. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/assets/ERD.png +0 -0
  24. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/assets/Launcher.png +0 -0
  25. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/assets/copy_minid.png +0 -0
  26. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/assets/deriva-logo.png +0 -0
  27. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/assets/deriva-ml.pdf +0 -0
  28. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/assets/sharing-at-home.pdf +0 -0
  29. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/code-docs/dataset.md +0 -0
  30. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/code-docs/dataset_aux_classes.md +0 -0
  31. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/code-docs/dataset_bag.md +0 -0
  32. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/code-docs/deriva_definitions.md +0 -0
  33. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/code-docs/deriva_ml_base.md +0 -0
  34. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/code-docs/deriva_model.md +0 -0
  35. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/code-docs/execution.md +0 -0
  36. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/code-docs/execution_configuration.md +0 -0
  37. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/code-docs/feature.md +0 -0
  38. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/code-docs/upload.md +0 -0
  39. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/index.md +0 -0
  40. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/release-notes.md +0 -0
  41. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/user-guide/datasets.md +0 -0
  42. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/user-guide/deriva_ml_structure.md +0 -0
  43. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/user-guide/execution-configuration.md +0 -0
  44. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/user-guide/file-assets.md +0 -0
  45. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/user-guide/identifiers.md +0 -0
  46. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/user-guide/install.md +0 -0
  47. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/user-guide/notebooks.md +0 -0
  48. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/docs/user-guide/overview.md +0 -0
  49. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/mkdocs.yml +0 -0
  50. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/pyproject.toml +0 -0
  51. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/setup.cfg +0 -0
  52. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/__init__.py +0 -0
  53. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/bump_version.py +0 -0
  54. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/core/__init__.py +0 -0
  55. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/core/base.py +0 -0
  56. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/core/constants.py +0 -0
  57. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/core/definitions.py +0 -0
  58. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/core/enums.py +0 -0
  59. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/core/ermrest.py +0 -0
  60. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/core/exceptions.py +0 -0
  61. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/core/filespec.py +0 -0
  62. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/dataset/__init__.py +0 -0
  63. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/dataset/aux_classes.py +0 -0
  64. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/dataset/dataset.py +0 -0
  65. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/dataset/dataset_bag.py +0 -0
  66. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/dataset/history.py +0 -0
  67. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/dataset/upload.py +0 -0
  68. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/demo_catalog.py +0 -0
  69. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/execution/__init__.py +0 -0
  70. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/execution/environment.py +0 -0
  71. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/execution/execution_configuration.py +0 -0
  72. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/feature.py +0 -0
  73. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/model/__init__.py +0 -0
  74. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/model/catalog.py +0 -0
  75. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/model/database.py +0 -0
  76. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/model/sql_mapper.py +0 -0
  77. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/run_notebook.py +0 -0
  78. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/schema/__init__.py +0 -0
  79. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/schema/annotations.py +0 -0
  80. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/schema/check_schema.py +0 -0
  81. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/schema/deriva-ml-reference.json +0 -0
  82. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/schema/policy.json +0 -0
  83. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml/schema/table_comments_utils.py +0 -0
  84. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml.egg-info/SOURCES.txt +0 -0
  85. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml.egg-info/dependency_links.txt +0 -0
  86. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml.egg-info/entry_points.txt +0 -0
  87. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml.egg-info/requires.txt +0 -0
  88. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/src/deriva_ml.egg-info/top_level.txt +0 -0
  89. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/__init__.py +0 -0
  90. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/core/__init__.py +0 -0
  91. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/core/test_basic_tables.py +0 -0
  92. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/core/test_file.py +0 -0
  93. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/core/test_vocabulary.py +0 -0
  94. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/dataset/__init__.py +0 -0
  95. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/dataset/demo-catalog-schema.json +0 -0
  96. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/dataset/deriva-ml-reference.json +0 -0
  97. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/dataset/eye-ai-catalog-schema.json +0 -0
  98. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/dataset/test_dataset_export.py +0 -0
  99. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/dataset/test_dataset_version.py +0 -0
  100. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/dataset/test_datasets.py +0 -0
  101. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/dataset/test_download.py +0 -0
  102. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/execution/__init__.py +0 -0
  103. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/execution/workflow-test.ipynb +0 -0
  104. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/execution/workflow-test.py +0 -0
  105. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/feature/test_features.py +0 -0
  106. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/model/__init__.py +0 -0
  107. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/model/test_database.py +0 -0
  108. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/model/test_models.py +0 -0
  109. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/test-files/execution-parameters.json +0 -0
  110. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/tests/test-files/notebook-parameters.json +0 -0
  111. {deriva_ml-1.14.36 → deriva_ml-1.14.37}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deriva-ml
3
- Version: 1.14.36
3
+ Version: 1.14.37
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
@@ -360,6 +360,14 @@ class Execution:
360
360
  with Path(cfile).open("w", encoding="utf-8") as config_file:
361
361
  json.dump(self.configuration.model_dump(), config_file)
362
362
 
363
+ lock_file = Path(self.configuration.workflow.git_root) / "uv.lock"
364
+ if lock_file.exists():
365
+ _ = self.asset_file_path(
366
+ MLAsset.execution_metadata,
367
+ lock_file,
368
+ ExecMetadataType.execution_config.value,
369
+ )
370
+
363
371
  for parameter_file in self.configuration.parameters:
364
372
  self.asset_file_path(
365
373
  MLAsset.execution_asset,
@@ -896,9 +904,7 @@ class Execution:
896
904
  asset_path.write_bytes(file_name.read_bytes())
897
905
 
898
906
  # Persist the asset types into a file
899
- with Path(
900
- asset_type_path(self._working_dir, self.execution_rid, asset_table)
901
- ).open("a") as asset_type_file:
907
+ with Path(asset_type_path(self._working_dir, self.execution_rid, asset_table)).open("a") as asset_type_file:
902
908
  asset_type_file.write(json.dumps({file_name.name: asset_types}) + "\n")
903
909
 
904
910
  return AssetFilePath(
@@ -84,6 +84,7 @@ class Workflow(BaseModel):
84
84
  rid: RID | None = None
85
85
  checksum: str | None = None
86
86
  is_notebook: bool = False
87
+ git_root: Path | None = None
87
88
 
88
89
  _logger: logging.Logger = PrivateAttr(default=10)
89
90
 
@@ -125,6 +126,7 @@ class Workflow(BaseModel):
125
126
  if not self.url:
126
127
  path, self.is_notebook = Workflow._get_python_script()
127
128
  self.url, self.checksum = Workflow.get_url_and_checksum(path)
129
+ self.git_root = Workflow._get_git_root(path)
128
130
 
129
131
  self._logger = logging.getLogger("deriva_ml")
130
132
  return self
@@ -315,12 +317,9 @@ class Workflow(BaseModel):
315
317
  ]
316
318
  # Get the caller's filename, which is two up the stack from here.
317
319
  filename = Path(stack[-1])
318
- if not filename.exists() or Workflow._in_repl():
320
+ if not (filename.exists() or Workflow._in_repl()):
319
321
  # Being called from the command line interpreter.
320
322
  filename = Path.cwd() / Path("REPL")
321
- # Get the caller's filename, which is two up the stack from here.
322
- else:
323
- raise DerivaMLException("Looking for caller failed") # Stack is too shallow
324
323
  return filename, is_notebook
325
324
 
326
325
  @staticmethod
@@ -1,9 +1,13 @@
1
1
  # your_pkg/install_kernel.py
2
- import sys
3
2
  import re
3
+ import sys
4
+ from argparse import ArgumentParser
4
5
  from importlib import metadata
6
+ from pathlib import Path
7
+
5
8
  from ipykernel.kernelspec import install as install_kernel
6
9
 
10
+
7
11
  def _dist_name_for_this_package() -> str:
8
12
  """
9
13
  Try to resolve the distribution name that provides this package.
@@ -20,6 +24,7 @@ def _dist_name_for_this_package() -> str:
20
24
  dist_name = dists[0] if dists else metadata.metadata(top_pkg).get("Name", top_pkg)
21
25
  return dist_name
22
26
 
27
+
23
28
  def _normalize_kernel_name(name: str) -> str:
24
29
  """
25
30
  Jupyter kernel directory names should be simple: lowercase, [-a-z0-9_].
@@ -28,19 +33,40 @@ def _normalize_kernel_name(name: str) -> str:
28
33
  name = re.sub(r"[^a-z0-9._-]+", "-", name)
29
34
  return name
30
35
 
36
+
37
+ def _name_for_this_venv() -> str:
38
+ config_path = Path(sys.prefix) / "pyvenv.cfg"
39
+ with config_path.open() as f:
40
+ m = re.search("prompt *= *(?P<prompt>.*)", f.read())
41
+ return m["prompt"] if m else ""
42
+
43
+
31
44
  def main() -> None:
32
- dist_name = _dist_name_for_this_package() # e.g., "deriva-model-template"
33
- kernel_name = _normalize_kernel_name(dist_name) # e.g., "deriva-model-template"
45
+ parser = ArgumentParser()
46
+ parser.add_argument(
47
+ "--install-local",
48
+ action="store_true",
49
+ help="Create kernal in local venv directory instead of sys.prefix.",
50
+ )
51
+
52
+ dist_name = _name_for_this_venv() # e.g., "deriva-model-template"
53
+ kernel_name = _normalize_kernel_name(dist_name) # e.g., "deriva-model-template"
34
54
  display_name = f"Python ({dist_name})"
35
55
 
36
56
  # Install into the current environment's prefix (e.g., .venv/share/jupyter/kernels/..)
57
+ prefix_arg = {}
58
+ install_local = False
59
+ if install_local:
60
+ prefix_arg = {"prefix": sys.prefix}
61
+
37
62
  install_kernel(
38
- user=False, # write under sys.prefix (the active env)
63
+ user=False, # write under sys.prefix (the active env)
39
64
  kernel_name=kernel_name,
40
65
  display_name=display_name,
41
- prefix=sys.prefix,
66
+ **prefix_arg,
42
67
  )
43
68
  print(f"Installed Jupyter kernel '{kernel_name}' with display name '{display_name}' under {sys.prefix!s}")
44
69
 
70
+
45
71
  if __name__ == "__main__":
46
- main()
72
+ main()
@@ -298,7 +298,7 @@ def initialize_ml_schema(model: Model, schema_name: str = "deriva-ml"):
298
298
  },
299
299
  {
300
300
  "Name": "Runtime_Env",
301
- "Description": "Information about the execution environment",
301
+ "Description": "Information about the runtime environment",
302
302
  },
303
303
  {
304
304
  "Name": "Execution_Metadata",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deriva-ml
3
- Version: 1.14.36
3
+ Version: 1.14.37
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
@@ -5,7 +5,6 @@ Pytest configuration and shared fixtures.
5
5
  import os
6
6
 
7
7
  import pytest
8
- from test_utils import MLCatalog, MLDatasetCatalog, create_jupyter_kernel, destroy_jupyter_kernel
9
8
 
10
9
  from deriva_ml import DerivaML
11
10
  from deriva_ml.demo_catalog import (
@@ -14,6 +13,8 @@ from deriva_ml.demo_catalog import (
14
13
  populate_demo_catalog,
15
14
  )
16
15
 
16
+ from .test_utils import MLCatalog, MLDatasetCatalog, create_jupyter_kernel, destroy_jupyter_kernel
17
+
17
18
 
18
19
  @pytest.fixture(scope="session")
19
20
  def catalog_host():
@@ -134,7 +134,10 @@ class TestExecution:
134
134
  }
135
135
  for a in metadata_path.entities().fetch()
136
136
  ]
137
- assert 2 == len(execution_metadata)
137
+ assert "uv.lock" in [d["Filename"] for d in execution_metadata]
138
+ assert "configuration.json" in [d["Filename"] for d in execution_metadata]
139
+
140
+ assert 3 == len(execution_metadata)
138
141
 
139
142
  def test_execution_upload(self, test_ml):
140
143
  ml_instance = test_ml
@@ -3,7 +3,6 @@ import shutil
3
3
  from tempfile import TemporaryDirectory
4
4
  from urllib.parse import quote as urlquote
5
5
 
6
- from demo_catalog import create_demo_features
7
6
  from deriva.core.datapath import DataPathException
8
7
  from ipykernel.kernelspec import install
9
8
  from jupyter_client.kernelspec import KernelSpecManager
@@ -13,6 +12,7 @@ from deriva_ml.demo_catalog import (
13
12
  DatasetDescription,
14
13
  create_demo_catalog,
15
14
  create_demo_datasets,
15
+ create_demo_features,
16
16
  populate_demo_catalog,
17
17
  )
18
18
 
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