deriva-ml 1.14.33__py3-none-any.whl → 1.14.35__py3-none-any.whl

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.
@@ -100,9 +100,6 @@ class Workflow(BaseModel):
100
100
  - DERIVA_ML_WORKFLOW_CHECKSUM: Override the computed checksum
101
101
 
102
102
  Args:
103
- name: Human-readable name for the workflow.
104
- workflow_type: Type of workflow (must be a vocabulary term).
105
- description: Optional description of workflow purpose.
106
103
 
107
104
  Returns:
108
105
  Workflow: New workflow instance with detected Git information.
@@ -240,6 +237,7 @@ class Workflow(BaseModel):
240
237
  """
241
238
 
242
239
  server, session = Workflow._get_notebook_session()
240
+
243
241
  if server and session:
244
242
  relative_path = session["notebook"]["path"]
245
243
  # Join the notebook directory with the relative path
@@ -321,8 +319,8 @@ class Workflow(BaseModel):
321
319
  # Being called from the command line interpreter.
322
320
  filename = Path.cwd() / Path("REPL")
323
321
  # Get the caller's filename, which is two up the stack from here.
324
- else:
325
- raise DerivaMLException("Looking for caller failed") # Stack is too shallow
322
+ else:
323
+ raise DerivaMLException("Looking for caller failed") # Stack is too shallow
326
324
  return filename, is_notebook
327
325
 
328
326
  @staticmethod
deriva_ml/feature.py CHANGED
@@ -52,6 +52,7 @@ class FeatureRecord(BaseModel):
52
52
 
53
53
  class Config:
54
54
  arbitrary_types_allowed = True
55
+ extra = "forbid"
55
56
 
56
57
  @classmethod
57
58
  def feature_columns(cls) -> set[Column]:
@@ -0,0 +1,46 @@
1
+ # your_pkg/install_kernel.py
2
+ import sys
3
+ import re
4
+ from importlib import metadata
5
+ from ipykernel.kernelspec import install as install_kernel
6
+
7
+ def _dist_name_for_this_package() -> str:
8
+ """
9
+ Try to resolve the distribution name that provides this package.
10
+ Works in editable installs and wheels.
11
+ """
12
+ # Top-level package name of this module (your_pkg)
13
+ top_pkg = __name__.split(".")[0]
14
+
15
+ # Map top-level packages -> distributions
16
+ pkg_to_dists = metadata.packages_distributions()
17
+ dists = pkg_to_dists.get(top_pkg) or []
18
+
19
+ # Fall back to project name in METADATA when mapping isn't available
20
+ dist_name = dists[0] if dists else metadata.metadata(top_pkg).get("Name", top_pkg)
21
+ return dist_name
22
+
23
+ def _normalize_kernel_name(name: str) -> str:
24
+ """
25
+ Jupyter kernel directory names should be simple: lowercase, [-a-z0-9_].
26
+ """
27
+ name = name.strip().lower()
28
+ name = re.sub(r"[^a-z0-9._-]+", "-", name)
29
+ return name
30
+
31
+ 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"
34
+ display_name = f"Python ({dist_name})"
35
+
36
+ # Install into the current environment's prefix (e.g., .venv/share/jupyter/kernels/..)
37
+ install_kernel(
38
+ user=False, # write under sys.prefix (the active env)
39
+ kernel_name=kernel_name,
40
+ display_name=display_name,
41
+ prefix=sys.prefix,
42
+ )
43
+ print(f"Installed Jupyter kernel '{kernel_name}' with display name '{display_name}' under {sys.prefix!s}")
44
+
45
+ if __name__ == "__main__":
46
+ main()
deriva_ml/run_notebook.py CHANGED
@@ -95,7 +95,7 @@ class DerivaMLRunNotebookCLI(BaseCLI):
95
95
  exit(1)
96
96
 
97
97
  os.environ["DERIVA_HOST"] = args.host
98
- os.environ["DERIVA_CATALOG_ID"] = args.catalog
98
+ os.environ["DERIVA_CATALOG"] = args.catalog
99
99
 
100
100
  # Create a workflow instance for this specific version of the script.
101
101
  # Return an existing workflow if one is found.
@@ -106,14 +106,14 @@ class DerivaMLRunNotebookCLI(BaseCLI):
106
106
  return
107
107
  else:
108
108
  notebook_parameters = (
109
- {"host": args.host, "catalog_id": args.catalog, "catalog": args.catalog}
110
- | {k: v["default"] for k, v in notebook_parameters.items()}
109
+ {k: v["default"] for k, v in notebook_parameters.items()}
110
+ | {"host": args.host, "hostname": args.host, "catalog_id": args.catalog, "catalog": args.catalog}
111
111
  | parameters
112
112
  )
113
113
  print(f"Running notebook {notebook_file.name} with parameters:")
114
114
  for param, value in notebook_parameters.items():
115
115
  print(f" {param}:{value}")
116
- self.run_notebook(notebook_file.resolve(), parameters, kernel=args.kernel, log=args.log_output)
116
+ self.run_notebook(notebook_file.resolve(), parameters, kernel=args.kernel[0], log=args.log_output)
117
117
 
118
118
  def run_notebook(self, notebook_file, parameters, kernel=None, log=False):
119
119
  url, checksum = Workflow.get_url_and_checksum(Path(notebook_file))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deriva-ml
3
- Version: 1.14.33
3
+ Version: 1.14.35
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
@@ -25,10 +25,9 @@ Deriva-ML is a python library to simplify the process of creating and executing
25
25
  using a deriva catalog.
26
26
 
27
27
 
28
- ## Installing the GitHub CLI
28
+ Complete on-line documentation for DerivaML can be found [here](https://informatics-isi-edu.github.io/deriva-ml/)
29
29
 
30
- The script release.sh will create a new release tag in GitHub. This script requires the
31
- GitHUB CLI be installed.
30
+ To get started using DerivaML, you can clone the [model template repository](https://github.com/informatics-isi-edu/deriva-ml-model-template), and modify it to suite your requirements.
32
31
 
33
- See [https://cli.github.com](https://cli.github.com) for instructions on how to install and configure the CLI.
34
32
 
33
+ ## References
@@ -1,7 +1,8 @@
1
1
  deriva_ml/__init__.py,sha256=_aMdxGG4mRTcXodLZLNpXqH8v5uqMbqFUryE9KqNSB8,1158
2
2
  deriva_ml/demo_catalog.py,sha256=JjPAIac_hKPh5krEhGJydjXquRnivi7kQoR8W4Khp-s,14928
3
- deriva_ml/feature.py,sha256=L1XUXLWGnUGCjkxX5KsGu0I8SaUTJG7eDs__yUCWuCY,8445
4
- deriva_ml/run_notebook.py,sha256=BvLtkD_uizukqkAYoSUb1teIfuBWtKKcHSyJoAnAC4c,6496
3
+ deriva_ml/feature.py,sha256=6-aphkxdKjWa9oPSGFWxHcwAc_8hmWj-7I4M178YG5Y,8470
4
+ deriva_ml/install_kernel.py,sha256=LHAdy7s-m2jIvzptMpxLdHHkHc62Tn16e9MUWSGIznA,1651
5
+ deriva_ml/run_notebook.py,sha256=XPZPtGDLv0Ej6dcqIwA1dx_ya1Z9kzsP7um473WtLpU,6519
5
6
  deriva_ml/core/__init__.py,sha256=V_i90pc5PB1F4UdOO6DZWzpEFaZDTaPRU-EzKXQ19eI,787
6
7
  deriva_ml/core/base.py,sha256=uG7xyVk12fXXWipusRmaBGplxbdlnN9sIOGAEHWD8i8,61090
7
8
  deriva_ml/core/constants.py,sha256=6wBJ8qMxe-dbCjRGrjUIX-RK0mTWrLDTeUpaVbLFoM8,888
@@ -20,7 +21,7 @@ deriva_ml/execution/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
20
21
  deriva_ml/execution/environment.py,sha256=B7nywqxFTRUWgyu8n7rFoKcVC9on422kjeFG2FPQfvg,9302
21
22
  deriva_ml/execution/execution.py,sha256=tXWkFLDoSre836x6MMkcmhtmr3zP5_VoSioQ72-XmvE,44298
22
23
  deriva_ml/execution/execution_configuration.py,sha256=Rw4VWkBCZN9yatvSKdTqEWTfu470lpcVKfHFR0uN0jI,6248
23
- deriva_ml/execution/workflow.py,sha256=Q5AvWOZLmveIobVKqTNo30HqpnLQ9Q9oy8klZBDKd3Q,13577
24
+ deriva_ml/execution/workflow.py,sha256=AeCT4eYAnYvBIx-Ar-Cyg64YoPyIB8IJdg3lKkCiKCU,13390
24
25
  deriva_ml/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
26
  deriva_ml/model/catalog.py,sha256=dzTBcRlqgEVkPY32AUax_iu75RgFiT4Pu5au7rmrv8k,14068
26
27
  deriva_ml/model/database.py,sha256=MlXQQFgFmGxZbRx-unRFoRttXwpJspV4v2AIgppttCU,14805
@@ -32,9 +33,9 @@ deriva_ml/schema/create_schema.py,sha256=0ydJSZEg3C3-m8hWPN6k2MoUvm-RWxAlKFzVChx
32
33
  deriva_ml/schema/deriva-ml-reference.json,sha256=AEOMIgwKO3dNMMWHb0lxaXyamvfAEbUPh8qw0aAtsUQ,242460
33
34
  deriva_ml/schema/policy.json,sha256=5ykB8nnZFl-oCHzlAwppCFKJHWJFIkYognUMVEanfY8,1826
34
35
  deriva_ml/schema/table_comments_utils.py,sha256=4flCqnZAaqg_uSZ9I18pNUWAZoLfmMCXbmI5uERY5vM,2007
35
- deriva_ml-1.14.33.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
36
- deriva_ml-1.14.33.dist-info/METADATA,sha256=IbEngyEfOSCucoY9aRrvK4nuI9zNpTmg-Kh4XZ7fmW0,1065
37
- deriva_ml-1.14.33.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
- deriva_ml-1.14.33.dist-info/entry_points.txt,sha256=dkf_z7E4V6_3_5Xjsm0hcixNg6ASHDw6NfYQuBvF1Wc,363
39
- deriva_ml-1.14.33.dist-info/top_level.txt,sha256=I1Q1dkH96cRghdsFRVqwpa2M7IqJpR2QPUNNc5-Bnpw,10
40
- deriva_ml-1.14.33.dist-info/RECORD,,
36
+ deriva_ml-1.14.35.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
37
+ deriva_ml-1.14.35.dist-info/METADATA,sha256=ozEBGEehEvA6IHHD2u_vf8cupR-tJIvNdr9QDHjObV0,1122
38
+ deriva_ml-1.14.35.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
39
+ deriva_ml-1.14.35.dist-info/entry_points.txt,sha256=Fg8f56jlXzbxzAqnIix7ntqZWmGdqmD11m1OOgiCXDM,420
40
+ deriva_ml-1.14.35.dist-info/top_level.txt,sha256=I1Q1dkH96cRghdsFRVqwpa2M7IqJpR2QPUNNc5-Bnpw,10
41
+ deriva_ml-1.14.35.dist-info/RECORD,,
@@ -2,5 +2,6 @@
2
2
  deriva-ml-alter-annotation = deriva_ml.schema_setup.alter_annotation:main
3
3
  deriva-ml-check-catalog-schema = deriva_ml.schema.check_schema:main
4
4
  deriva-ml-create-schema = deriva_ml.schema_setup.create_schema:main
5
+ deriva-ml-install-kernel = deriva_ml.install_kernel:main
5
6
  deriva-ml-run-notebook = deriva_ml.run_notebook:main
6
7
  deriva-ml-table-comments-utils = deriva_ml.schema_setup.table_comments_utils:main