deriva-ml 1.8.10__py3-none-any.whl → 1.9.0__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/database_model.py +27 -4
- deriva_ml/dataset.py +14 -9
- deriva_ml/dataset_bag.py +1 -1
- deriva_ml/demo_catalog.py +9 -8
- deriva_ml/deriva_definitions.py +8 -3
- deriva_ml/deriva_ml_base.py +142 -50
- deriva_ml/deriva_model.py +2 -2
- deriva_ml/execution.py +9 -16
- deriva_ml/execution_configuration.py +20 -23
- deriva_ml/schema_setup/annotations.py +1 -1
- deriva_ml/schema_setup/create_schema.py +3 -2
- deriva_ml/upload.py +1 -1
- {deriva_ml-1.8.10.dist-info → deriva_ml-1.9.0.dist-info}/METADATA +1 -1
- deriva_ml-1.9.0.dist-info/RECORD +27 -0
- deriva_ml/build/lib/schema_setup/__init__.py +0 -0
- deriva_ml/build/lib/schema_setup/alter_annotation.py +0 -36
- deriva_ml/build/lib/schema_setup/annotation_temp.py +0 -255
- deriva_ml/build/lib/schema_setup/create_schema.py +0 -165
- deriva_ml/build/lib/schema_setup/table_comments_utils.py +0 -56
- deriva_ml/schema_setup/alter_annotation.py +0 -55
- deriva_ml-1.8.10.dist-info/RECORD +0 -33
- {deriva_ml-1.8.10.dist-info → deriva_ml-1.9.0.dist-info}/WHEEL +0 -0
- {deriva_ml-1.8.10.dist-info → deriva_ml-1.9.0.dist-info}/entry_points.txt +0 -0
- {deriva_ml-1.8.10.dist-info → deriva_ml-1.9.0.dist-info}/licenses/LICENSE +0 -0
- {deriva_ml-1.8.10.dist-info → deriva_ml-1.9.0.dist-info}/top_level.txt +0 -0
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
from deriva.core import ErmrestCatalog, get_credential
|
|
3
|
-
import argparse
|
|
4
|
-
import os
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def update_table_comments(model, schema_name: str, table_name: str, comments_dir: str) -> None:
|
|
9
|
-
table = model.schemas[schema_name].tables[table_name]
|
|
10
|
-
table_comments_dir = Path(comments_dir)/Path(f"{schema_name}/{table_name}")
|
|
11
|
-
for file in os.listdir(table_comments_dir):
|
|
12
|
-
file_path = os.path.join(table_comments_dir, file)
|
|
13
|
-
with open(file_path, "r") as f:
|
|
14
|
-
comment_str = f.read()
|
|
15
|
-
if file.split(".")[0] == table_name:
|
|
16
|
-
table.comment = comment_str
|
|
17
|
-
else:
|
|
18
|
-
table.columns[file.split(".")[0]].comment = comment_str
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def update_schema_comments(model, schema_name: str, comments_dir: str) -> None:
|
|
22
|
-
schema_comments_dir = Path(comments_dir)/Path(schema_name)
|
|
23
|
-
for table in os.listdir(schema_comments_dir):
|
|
24
|
-
if not table.endswith(".DS_Store"):
|
|
25
|
-
update_table_comments(model, schema_name, table, comments_dir)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def main():
|
|
29
|
-
scheme = 'https'
|
|
30
|
-
parser = argparse.ArgumentParser()
|
|
31
|
-
parser.add_argument('--hostname', type=str, required=True)
|
|
32
|
-
parser.add_argument('--schema_name', type=str, required=True)
|
|
33
|
-
parser.add_argument('--catalog_id', type=str, required=True)
|
|
34
|
-
parser.add_argument('--comments_dir', type=str, required=True,
|
|
35
|
-
help="The directory containing the comments files for the whole catalog")
|
|
36
|
-
parser.add_argument('--table_name', type=str,
|
|
37
|
-
help="Only update the comments for one table")
|
|
38
|
-
args = parser.parse_args()
|
|
39
|
-
|
|
40
|
-
credentials = get_credential(args.hostname)
|
|
41
|
-
catalog = ErmrestCatalog(scheme, args.hostname, args.catalog_id, credentials)
|
|
42
|
-
model = catalog.getCatalogModel()
|
|
43
|
-
if args.table_name:
|
|
44
|
-
update_table_comments(model, args.schema_name, args.table_name, args.comments_dir)
|
|
45
|
-
model.apply()
|
|
46
|
-
else:
|
|
47
|
-
update_schema_comments(model, args.schema_name, args.comments_dir)
|
|
48
|
-
model.apply()
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if __name__ == '__main__':
|
|
52
|
-
sys.exit(main())
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
# docs/<schema-name>/<table-name>/[table|<column-name>.Md
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
import argparse
|
|
3
|
-
from deriva.core import get_credential, ErmrestCatalog
|
|
4
|
-
from deriva.core.ermrest_model import Model
|
|
5
|
-
|
|
6
|
-
from deriva_ml.schema_setup.annotations import generate_annotation
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def alter_table_annotation(
|
|
10
|
-
model_root: Model, schema_name: str, table_name: str, annotation: dict
|
|
11
|
-
):
|
|
12
|
-
table = model_root.schemas[schema_name].tables[table_name]
|
|
13
|
-
table.alter(annotations=annotation)
|
|
14
|
-
model_root.apply()
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def alter_schema_annotation(model_root: Model, schema_name: str, annotation: dict):
|
|
18
|
-
schema = model_root.schemas[schema_name]
|
|
19
|
-
schema.alter(annotations=annotation)
|
|
20
|
-
model_root.apply()
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def main():
|
|
24
|
-
parser = argparse.ArgumentParser()
|
|
25
|
-
parser.add_argument("--hostname", type=str, required=True)
|
|
26
|
-
parser.add_argument("--schema_name", type=str, required=True)
|
|
27
|
-
parser.add_argument("--catalog_id", type=str, required=True)
|
|
28
|
-
args = parser.parse_args()
|
|
29
|
-
credentials = get_credential(args.hostname)
|
|
30
|
-
catalog = ErmrestCatalog("https", args.hostname, args.catalog_id, credentials)
|
|
31
|
-
model = catalog.getCatalogModel()
|
|
32
|
-
annotations = generate_annotation(model)
|
|
33
|
-
alter_table_annotation(
|
|
34
|
-
model, args.schema_name, "Workflow", annotations["workflow_annotation"]
|
|
35
|
-
)
|
|
36
|
-
alter_table_annotation(
|
|
37
|
-
model, args.schema_name, "Execution", annotations["execution_annotation"]
|
|
38
|
-
)
|
|
39
|
-
alter_table_annotation(
|
|
40
|
-
model,
|
|
41
|
-
args.schema_name,
|
|
42
|
-
"Execution_Metadata",
|
|
43
|
-
annotations["execution_metadata_annotation"],
|
|
44
|
-
)
|
|
45
|
-
alter_table_annotation(
|
|
46
|
-
model,
|
|
47
|
-
args.schema_name,
|
|
48
|
-
"Execution_Asset",
|
|
49
|
-
annotations["execution_asset_annotation"],
|
|
50
|
-
)
|
|
51
|
-
alter_schema_annotation(model, args.schema_name, annotations["schema_annotation"])
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if __name__ == "__main__":
|
|
55
|
-
sys.exit(main())
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
deriva_ml/__init__.py,sha256=r1Z9N5vtZkAET7emqhpAx2bf_xJUp5wHOc4_DIplsG8,1082
|
|
2
|
-
deriva_ml/database_model.py,sha256=uhoyVyd8MQmY8J9ovCH8fjxhZDxxXNkdJyYdeyEGPXA,13898
|
|
3
|
-
deriva_ml/dataset.py,sha256=xC6QPUp4MZcJiEnOEU3NnzoLBL9RcJWtPTyzIQP0Ivw,60666
|
|
4
|
-
deriva_ml/dataset_aux_classes.py,sha256=YxjQnu2kS9kK_f8bGqhmgE6ty9GNeitCxfvReT9vaM0,6537
|
|
5
|
-
deriva_ml/dataset_bag.py,sha256=e6IHv3saZUnZRfl0EjfnlV2NnmPeOagYYv3PuZqS1l0,11501
|
|
6
|
-
deriva_ml/demo_catalog.py,sha256=xQPhFlflqwJskNQrQ-jdBSnGzBm2-aONBgcRxfsdNKM,11045
|
|
7
|
-
deriva_ml/deriva_definitions.py,sha256=pZLPoUxiuJ-uGglmQ6sF9oVXsSUuOnPEqywoec78XNM,8893
|
|
8
|
-
deriva_ml/deriva_ml_base.py,sha256=aVyGsFERZtpjNxfaVYzvKa7J0Ma-U3DEibfjnbr7lFQ,43817
|
|
9
|
-
deriva_ml/deriva_model.py,sha256=LV3FjIhIlz13ckZSmu0aOJhT9EVE0-M9oVMudfkxb0g,12004
|
|
10
|
-
deriva_ml/execution.py,sha256=VlapQGPDQI2MOmYnA5-hpf-XM6Fu4hPLpFjNN5q9Udo,29889
|
|
11
|
-
deriva_ml/execution_configuration.py,sha256=bjnZwXN6M7YPy5dFQwoGEBU8YjhQRSe1FW0rL0V9TaM,3422
|
|
12
|
-
deriva_ml/execution_environment.py,sha256=bCRKrCELDbGQDo7_FKfw7e8iMzVjSRZK3baKkqH5-_0,3264
|
|
13
|
-
deriva_ml/feature.py,sha256=7e8WYPCfJSrGxJh9oUTduYSnB5ekybRhXa_0HIigS_w,5459
|
|
14
|
-
deriva_ml/history.py,sha256=qTDLDs8Ow_6r7mDO0gZm0Fg81SWKOAgtCU5pzZoDRgM,2828
|
|
15
|
-
deriva_ml/test_functions.py,sha256=-eqLHjjCQCLBNAr1ofbZekNiCOfMISSACRxT_YHER8I,4396
|
|
16
|
-
deriva_ml/upload.py,sha256=CKtT-gBln3pnAll9TFaiPhFSHC-bzg9oE4ruh_OSOqY,22270
|
|
17
|
-
deriva_ml/build/lib/schema_setup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
deriva_ml/build/lib/schema_setup/alter_annotation.py,sha256=pkwk0WystN69JfAFK4iBJZAZVQKbRs-gN9IFYuS9rfg,1739
|
|
19
|
-
deriva_ml/build/lib/schema_setup/annotation_temp.py,sha256=Euygu8wNklZFUbR6mz-pDWJemlzdsIn9d6j0f6fCfgE,9102
|
|
20
|
-
deriva_ml/build/lib/schema_setup/create_schema.py,sha256=9LI2ivR0xS4kVBxkz3F1Ac4hoYGGOVkXYmuhllqWvKE,6528
|
|
21
|
-
deriva_ml/build/lib/schema_setup/table_comments_utils.py,sha256=-2_ubEpoH7ViLVb-ZfW9wZbQ26DTKNgjkCABMzGu4i4,2140
|
|
22
|
-
deriva_ml/schema_setup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
|
-
deriva_ml/schema_setup/alter_annotation.py,sha256=HyGWe4fBLQY0wbcKnfrhEoVDs4SfnoOF0l_Rz5-tDlk,1794
|
|
24
|
-
deriva_ml/schema_setup/annotations.py,sha256=Uogm9YkRtoKSdgfQlICqRywbCATppwBO-XryVSVyso8,9546
|
|
25
|
-
deriva_ml/schema_setup/create_schema.py,sha256=jwziMWJPbjRgjiRBT-KtidnXI8YNEFO74A9fwfptjHY,10626
|
|
26
|
-
deriva_ml/schema_setup/policy.json,sha256=77sf0Imy6CAQV0_VwwbA56_KROJ05WXsvT-Wjtkk538,1633
|
|
27
|
-
deriva_ml/schema_setup/table_comments_utils.py,sha256=-2_ubEpoH7ViLVb-ZfW9wZbQ26DTKNgjkCABMzGu4i4,2140
|
|
28
|
-
deriva_ml-1.8.10.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
29
|
-
deriva_ml-1.8.10.dist-info/METADATA,sha256=Mhx0joyR1gPEX8G6ZoEpvxNVW4sUG9C_S5TIA6ueZKk,670
|
|
30
|
-
deriva_ml-1.8.10.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
|
31
|
-
deriva_ml-1.8.10.dist-info/entry_points.txt,sha256=ZiOvrYj022x544TQwi018ujeHRRDahNmwJnzn5ThacM,242
|
|
32
|
-
deriva_ml-1.8.10.dist-info/top_level.txt,sha256=I1Q1dkH96cRghdsFRVqwpa2M7IqJpR2QPUNNc5-Bnpw,10
|
|
33
|
-
deriva_ml-1.8.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|