deriva-ml 1.14.34__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.
- deriva_ml/execution/workflow.py +3 -5
- deriva_ml/install_kernel.py +46 -0
- {deriva_ml-1.14.34.dist-info → deriva_ml-1.14.35.dist-info}/METADATA +1 -1
- {deriva_ml-1.14.34.dist-info → deriva_ml-1.14.35.dist-info}/RECORD +8 -7
- {deriva_ml-1.14.34.dist-info → deriva_ml-1.14.35.dist-info}/entry_points.txt +1 -0
- {deriva_ml-1.14.34.dist-info → deriva_ml-1.14.35.dist-info}/WHEEL +0 -0
- {deriva_ml-1.14.34.dist-info → deriva_ml-1.14.35.dist-info}/licenses/LICENSE +0 -0
- {deriva_ml-1.14.34.dist-info → deriva_ml-1.14.35.dist-info}/top_level.txt +0 -0
deriva_ml/execution/workflow.py
CHANGED
|
@@ -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
|
-
|
|
325
|
-
|
|
322
|
+
else:
|
|
323
|
+
raise DerivaMLException("Looking for caller failed") # Stack is too shallow
|
|
326
324
|
return filename, is_notebook
|
|
327
325
|
|
|
328
326
|
@staticmethod
|
|
@@ -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()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
deriva_ml/__init__.py,sha256=_aMdxGG4mRTcXodLZLNpXqH8v5uqMbqFUryE9KqNSB8,1158
|
|
2
2
|
deriva_ml/demo_catalog.py,sha256=JjPAIac_hKPh5krEhGJydjXquRnivi7kQoR8W4Khp-s,14928
|
|
3
3
|
deriva_ml/feature.py,sha256=6-aphkxdKjWa9oPSGFWxHcwAc_8hmWj-7I4M178YG5Y,8470
|
|
4
|
+
deriva_ml/install_kernel.py,sha256=LHAdy7s-m2jIvzptMpxLdHHkHc62Tn16e9MUWSGIznA,1651
|
|
4
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
|
|
@@ -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=
|
|
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.
|
|
36
|
-
deriva_ml-1.14.
|
|
37
|
-
deriva_ml-1.14.
|
|
38
|
-
deriva_ml-1.14.
|
|
39
|
-
deriva_ml-1.14.
|
|
40
|
-
deriva_ml-1.14.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|