deriva-ml 1.14.43__tar.gz → 1.14.45__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.43 → deriva_ml-1.14.45}/PKG-INFO +2 -1
  2. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/pyproject.toml +3 -2
  3. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/core/base.py +12 -0
  4. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/dataset/dataset.py +4 -4
  5. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/dataset/upload.py +0 -2
  6. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/run_notebook.py +22 -13
  7. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml.egg-info/PKG-INFO +2 -1
  8. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml.egg-info/SOURCES.txt +0 -1
  9. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml.egg-info/requires.txt +1 -0
  10. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/uv.lock +472 -366
  11. deriva_ml-1.14.43/tests/dataset/test_dataset_export.py +0 -30
  12. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/.github/release-drafter.yml +0 -0
  13. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/.github/workflows/publish-docs.yml +0 -0
  14. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/.github/workflows/release.yml +0 -0
  15. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/.gitignore +0 -0
  16. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/LICENSE +0 -0
  17. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/README.md +0 -0
  18. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/.DS_Store +0 -0
  19. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/Notebooks/DerivaML Create Notes.ipynb +0 -0
  20. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/Notebooks/DerivaML Dataset.ipynb +0 -0
  21. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/Notebooks/DerivaML Execution.ipynb +0 -0
  22. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/Notebooks/DerivaML Features.ipynb +0 -0
  23. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/Notebooks/DerivaML Ingest.ipynb +0 -0
  24. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/Notebooks/DerivaML Vocabulary.ipynb +0 -0
  25. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/assets/ERD.png +0 -0
  26. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/assets/Launcher.png +0 -0
  27. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/assets/copy_minid.png +0 -0
  28. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/assets/deriva-logo.png +0 -0
  29. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/assets/deriva-ml.pdf +0 -0
  30. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/assets/sharing-at-home.pdf +0 -0
  31. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/code-docs/dataset.md +0 -0
  32. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/code-docs/dataset_aux_classes.md +0 -0
  33. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/code-docs/dataset_bag.md +0 -0
  34. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/code-docs/deriva_definitions.md +0 -0
  35. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/code-docs/deriva_ml_base.md +0 -0
  36. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/code-docs/deriva_model.md +0 -0
  37. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/code-docs/execution.md +0 -0
  38. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/code-docs/execution_configuration.md +0 -0
  39. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/code-docs/feature.md +0 -0
  40. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/code-docs/upload.md +0 -0
  41. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/index.md +0 -0
  42. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/release-notes.md +0 -0
  43. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/user-guide/datasets.md +0 -0
  44. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/user-guide/deriva_ml_structure.md +0 -0
  45. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/user-guide/execution-configuration.md +0 -0
  46. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/user-guide/file-assets.md +0 -0
  47. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/user-guide/identifiers.md +0 -0
  48. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/user-guide/install.md +0 -0
  49. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/user-guide/notebooks.md +0 -0
  50. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/docs/user-guide/overview.md +0 -0
  51. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/mkdocs.yml +0 -0
  52. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/setup.cfg +0 -0
  53. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/__init__.py +0 -0
  54. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/bump_version.py +0 -0
  55. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/core/__init__.py +0 -0
  56. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/core/constants.py +0 -0
  57. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/core/definitions.py +0 -0
  58. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/core/enums.py +0 -0
  59. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/core/ermrest.py +0 -0
  60. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/core/exceptions.py +0 -0
  61. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/core/filespec.py +0 -0
  62. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/dataset/__init__.py +0 -0
  63. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/dataset/aux_classes.py +0 -0
  64. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/dataset/dataset_bag.py +0 -0
  65. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/dataset/history.py +0 -0
  66. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/demo_catalog.py +0 -0
  67. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/execution/__init__.py +0 -0
  68. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/execution/environment.py +0 -0
  69. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/execution/execution.py +0 -0
  70. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/execution/execution_configuration.py +0 -0
  71. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/execution/workflow.py +0 -0
  72. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/feature.py +0 -0
  73. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/install_kernel.py +0 -0
  74. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/model/__init__.py +0 -0
  75. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/model/catalog.py +0 -0
  76. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/model/database.py +0 -0
  77. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/model/sql_mapper.py +0 -0
  78. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/schema/__init__.py +0 -0
  79. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/schema/annotations.py +0 -0
  80. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/schema/check_schema.py +0 -0
  81. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/schema/create_schema.py +0 -0
  82. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/schema/deriva-ml-reference.json +0 -0
  83. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/schema/policy.json +0 -0
  84. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml/schema/table_comments_utils.py +0 -0
  85. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml.egg-info/dependency_links.txt +0 -0
  86. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml.egg-info/entry_points.txt +0 -0
  87. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/src/deriva_ml.egg-info/top_level.txt +0 -0
  88. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/__init__.py +0 -0
  89. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/conftest.py +0 -0
  90. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/core/__init__.py +0 -0
  91. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/core/test_basic_tables.py +0 -0
  92. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/core/test_file.py +0 -0
  93. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/core/test_vocabulary.py +0 -0
  94. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/dataset/__init__.py +0 -0
  95. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/dataset/demo-catalog-schema.json +0 -0
  96. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/dataset/deriva-ml-reference.json +0 -0
  97. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/dataset/eye-ai-catalog-schema.json +0 -0
  98. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/dataset/test_dataset_version.py +0 -0
  99. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/dataset/test_datasets.py +0 -0
  100. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/dataset/test_download.py +0 -0
  101. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/execution/__init__.py +0 -0
  102. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/execution/test_execution.py +0 -0
  103. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/execution/workflow-test.ipynb +0 -0
  104. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/execution/workflow-test.py +0 -0
  105. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/feature/test_features.py +0 -0
  106. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/model/__init__.py +0 -0
  107. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/model/test_database.py +0 -0
  108. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/model/test_models.py +0 -0
  109. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/test-files/execution-parameters.json +0 -0
  110. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/test-files/notebook-parameters.json +0 -0
  111. {deriva_ml-1.14.43 → deriva_ml-1.14.45}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deriva-ml
3
- Version: 1.14.43
3
+ Version: 1.14.45
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
@@ -20,6 +20,7 @@ Requires-Dist: setuptools-scm>=8.0
20
20
  Requires-Dist: nbstripout
21
21
  Requires-Dist: papermill
22
22
  Requires-Dist: pandas-stubs==2.2.3.250527
23
+ Requires-Dist: pyyaml
23
24
  Dynamic: license-file
24
25
 
25
26
  # DerivaML
@@ -22,6 +22,7 @@ dependencies = [
22
22
  "nbstripout",
23
23
  "papermill",
24
24
  "pandas-stubs==2.2.3.250527",
25
+ "pyyaml"
25
26
  ]
26
27
 
27
28
  [project.scripts]
@@ -43,8 +44,8 @@ build-backend = "setuptools.build_meta"
43
44
  [tool.uv]
44
45
 
45
46
  [tool.uv.sources]
46
- bdbag = {git = "https://github.com/fair-research/bdbag", branch = "master" }
47
- deriva = {git = "https://github.com/informatics-isi-edu/deriva-py", branch = "master" }
47
+ #bdbag = {git = "https://github.com/fair-research/bdbag", branch = "master" }
48
+ #deriva = {git = "https://github.com/informatics-isi-edu/deriva-py", branch = "master" }
48
49
 
49
50
 
50
51
  [tool.setuptools.package-data]
@@ -120,6 +120,7 @@ class DerivaML(Dataset):
120
120
  logging_level=logging.WARNING,
121
121
  credential=None,
122
122
  use_minid: bool = True,
123
+ check_auth: bool = True,
123
124
  ):
124
125
  """Initializes a DerivaML instance.
125
126
 
@@ -139,6 +140,7 @@ class DerivaML(Dataset):
139
140
  working_dir: Directory path for storing data used by or generated by any computations. If no value is
140
141
  provided, will default to ${HOME}/deriva_ml
141
142
  use_minid: Use the MINID service when downloading dataset bags.
143
+ check_auth: Check if the user has access to the catalog.
142
144
  """
143
145
  # Get or use provided credentials for server access
144
146
  self.credential = credential or get_credential(hostname)
@@ -150,6 +152,16 @@ class DerivaML(Dataset):
150
152
  credentials=self.credential,
151
153
  session_config=self._get_session_config(),
152
154
  )
155
+
156
+ try:
157
+ if check_auth and server.get_authn_session():
158
+ pass
159
+ except Exception:
160
+ raise DerivaMLException(
161
+ "You are not authorized to access this catalog. "
162
+ "Please check your credentials and make sure you have logged in."
163
+ )
164
+
153
165
  self.catalog = server.connect_ermrest(catalog_id)
154
166
  self.model = DerivaModel(self.catalog.getCatalogModel(), domain_schema=domain_schema)
155
167
 
@@ -1289,8 +1289,8 @@ class Dataset:
1289
1289
  {
1290
1290
  "processor": "fetch",
1291
1291
  "processor_params": {
1292
- "query_path": f"/attribute/{spath}/!(URL::null::)/url:=URL,length:=Length,filename:=Filename,md5:=MD5",
1293
- "output_path": f"asset/{table.name}",
1292
+ "query_path": f"/attribute/{spath}/!(URL::null::)/url:=URL,length:=Length,filename:=Filename,md5:=MD5,asset_rid:=RID",
1293
+ "output_path": "asset/{asset_rid}/" + table.name,
1294
1294
  },
1295
1295
  }
1296
1296
  )
@@ -1341,9 +1341,9 @@ class Dataset:
1341
1341
  "source": {
1342
1342
  "skip_root_path": False,
1343
1343
  "api": "attribute",
1344
- "path": f"{spath}/!(URL::null::)/url:=URL,length:=Length,filename:=Filename,md5:=MD5",
1344
+ "path": f"{spath}/!(URL::null::)/url:=URL,length:=Length,filename:=Filename,md5:=MD5, asset_rid:=RID",
1345
1345
  },
1346
- "destination": {"name": f"asset/{table.name}", "type": "fetch"},
1346
+ "destination": {"name": "asset/{asset_rid}/" + table.name, "type": "fetch"},
1347
1347
  }
1348
1348
  )
1349
1349
  return exports
@@ -296,7 +296,6 @@ def upload_directory(model: DerivaModel, directory: Path | str) -> dict[Any, Fil
296
296
 
297
297
  with spec_file.open("w+") as cfile:
298
298
  json.dump(bulk_upload_configuration(model), cfile)
299
- print("Creating GenericUploader...")
300
299
  uploader = GenericUploader(
301
300
  server={
302
301
  "host": model.hostname,
@@ -318,7 +317,6 @@ def upload_directory(model: DerivaModel, directory: Path | str) -> dict[Any, Fil
318
317
  }
319
318
  finally:
320
319
  uploader.cleanup()
321
- print(f"Cleanup called...{uploader}")
322
320
  return results
323
321
 
324
322
 
@@ -9,8 +9,9 @@ from pathlib import Path
9
9
  import nbformat
10
10
  import papermill as pm
11
11
  import regex as re
12
+ import yaml
12
13
  from deriva.core import BaseCLI
13
- from nbconvert import HTMLExporter
14
+ from nbconvert import MarkdownExporter
14
15
 
15
16
  from deriva_ml import DerivaML, ExecAssetType, Execution, ExecutionConfiguration, MLAsset, Workflow
16
17
 
@@ -28,7 +29,7 @@ class DerivaMLRunNotebookCLI(BaseCLI):
28
29
  "-f",
29
30
  type=Path,
30
31
  default=None,
31
- help="JSON file with parameter values to inject into the notebook.",
32
+ help="JSON or YAML file with parameter values to inject into the notebook.",
32
33
  )
33
34
 
34
35
  self.parser.add_argument(
@@ -86,11 +87,14 @@ class DerivaMLRunNotebookCLI(BaseCLI):
86
87
  parameters = {key: self._coerce_number(val) for key, val in args.parameter}
87
88
 
88
89
  if parameter_file:
89
- if not (parameter_file.is_file() and parameter_file.suffix == ".json"):
90
- print("Parameter file must be an json file.")
91
- exit(1)
92
- with Path(parameter_file).open("r") as f:
93
- parameters |= json.load(f)
90
+ with parameter_file.open("r") as f:
91
+ if parameter_file.suffix == ".json":
92
+ parameters |= json.load(f)
93
+ elif parameter_file.suffix == ".yaml":
94
+ parameters |= yaml.safe_load(f)
95
+ else:
96
+ print("Parameter file must be an json or YAML file.")
97
+ exit(1)
94
98
 
95
99
  if not (notebook_file.is_file() and notebook_file.suffix == ".ipynb"):
96
100
  print(f"Notebook file must be an ipynb file: {notebook_file.name}.")
@@ -157,11 +161,16 @@ class DerivaMLRunNotebookCLI(BaseCLI):
157
161
  )
158
162
 
159
163
  # Generate an HTML version of the output notebook.
164
+ notebook_output_md = notebook_output.with_suffix(".md")
165
+ with notebook_output.open() as f:
166
+ nb = nbformat.read(f, as_version=4)
167
+ # Convert to Markdown
168
+ exporter = MarkdownExporter()
169
+ (body, resources) = exporter.from_notebook_node(nb)
170
+
171
+ with notebook_output_md.open("w") as f:
172
+ f.write(body)
160
173
  nb = nbformat.read(notebook_output, as_version=4)
161
- html_exporter = HTMLExporter(template_name="classic")
162
- body, resources = html_exporter.from_notebook_node(nb)
163
- notebook_output_html = notebook_output.with_suffix(".html")
164
- notebook_output_html.write_text(body, encoding="utf-8")
165
174
 
166
175
  execution.asset_file_path(
167
176
  asset_name=MLAsset.execution_asset,
@@ -171,12 +180,12 @@ class DerivaMLRunNotebookCLI(BaseCLI):
171
180
 
172
181
  execution.asset_file_path(
173
182
  asset_name=MLAsset.execution_asset,
174
- file_name=notebook_output_html,
183
+ file_name=notebook_output_md,
175
184
  asset_types=ExecAssetType.notebook_output,
176
185
  )
177
186
  execution.asset_file_path(
178
187
  asset_name=MLAsset.execution_asset,
179
- file_name=notebook_output_html,
188
+ file_name=notebook_output_md,
180
189
  asset_types=ExecAssetType.notebook_output,
181
190
  )
182
191
  print("parameter....")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deriva-ml
3
- Version: 1.14.43
3
+ Version: 1.14.45
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
@@ -20,6 +20,7 @@ Requires-Dist: setuptools-scm>=8.0
20
20
  Requires-Dist: nbstripout
21
21
  Requires-Dist: papermill
22
22
  Requires-Dist: pandas-stubs==2.2.3.250527
23
+ Requires-Dist: pyyaml
23
24
  Dynamic: license-file
24
25
 
25
26
  # DerivaML
@@ -93,7 +93,6 @@ tests/dataset/__init__.py
93
93
  tests/dataset/demo-catalog-schema.json
94
94
  tests/dataset/deriva-ml-reference.json
95
95
  tests/dataset/eye-ai-catalog-schema.json
96
- tests/dataset/test_dataset_export.py
97
96
  tests/dataset/test_dataset_version.py
98
97
  tests/dataset/test_datasets.py
99
98
  tests/dataset/test_download.py
@@ -12,3 +12,4 @@ setuptools-scm>=8.0
12
12
  nbstripout
13
13
  papermill
14
14
  pandas-stubs==2.2.3.250527
15
+ pyyaml