Skip to content

Commit 2209973

Browse files
authored
Merge pull request #204 from lanl/guuid_bugfix
Guuid bugfix
2 parents 0a8eed5 + 68211a5 commit 2209973

File tree

5 files changed

+138
-1851
lines changed

5 files changed

+138
-1851
lines changed

dsi/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ def index(self, local_loc, remote_loc, isVerbose=False):
14401440
st_dict['n_links'] = []
14411441
st_dict['uid'] = []
14421442
st_dict['gid'] = []
1443-
#st_dict['uuid'] = []
1443+
st_dict['uuid'] = []
14441444
st_dict['file_remote'] = []
14451445

14461446
for file in file_list:
@@ -1462,7 +1462,7 @@ def index(self, local_loc, remote_loc, isVerbose=False):
14621462
st_dict['n_links'].append(st.st_nlink)
14631463
st_dict['uid'].append(st.st_uid)
14641464
st_dict['gid'].append(st.st_gid)
1465-
#st_dict['uuid'].append(self.gen_uuid(st))
1465+
st_dict['uuid'].append(self.gen_uuid(st))
14661466
st_dict['file_remote'].append(rfilepath)
14671467
st_list.append(st)
14681468

@@ -1733,7 +1733,7 @@ def gen_uuid(self, st):
17331733

17341734
file_uuid = uuid.uuid5(uuid.NAMESPACE_URL, unique_str)
17351735
#print(f"UUID:{file_uuid}")
1736-
return file_uuid
1736+
return str(file_uuid)
17371737

17381738

17391739

4 Bytes
Binary file not shown.

examples/clover3d/schema2.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"genesis_datacard": {
3+
"primary_key": "Title"
4+
},
5+
"simulation": {
6+
"primary_key": "sim_id",
7+
"foreign_key": {
8+
"dataset": ["genesis_datacard", "Title"]
9+
}
10+
},
11+
"input": {
12+
"foreign_key": {
13+
"sim_id": ["simulation", "sim_id"]
14+
}
15+
},
16+
"output": {
17+
"foreign_key": {
18+
"sim_id": ["simulation", "sim_id"]
19+
}
20+
},
21+
"viz_files": {
22+
"foreign_key": {
23+
"sim_id": ["simulation", "sim_id"]
24+
}
25+
}
26+
}

examples/dsi_diana_tutorial.ipynb

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
"The goal of the Data Science Infrastructure Project ([DSI](https://github.com/lanl/dsi)) is to provide a flexible, AI-ready metadata query capability which returns data subject to strict, POSIX-enforced file security. In this tutorial, you will learn how to:\n",
1111
" - initialize a DSI instance\n",
1212
" - load Tier 1 metadata into DSI\n",
13-
" - check the data loaded\n",
14-
" - query the data\n",
13+
" - check the metadata loaded\n",
14+
" - query the metadata\n",
1515
" - load Tier 2 and Tier 3 metadata into DSI\n",
1616
" - apply a complex schema\n",
17-
" - use DSI Sync to index and move data\n",
17+
" - use DSI Sync to index and move data and metadata\n",
1818
"\n",
1919
"This tutorial uses data from the [Cloverleaf3D](https://github.com/UK-MAC/CloverLeaf3D) Lagrangian-Eulerian hydrodynamics solver. Data is provided in dsi/examples/clover3d/. Prior to running the tutorial, follow the instructions in the [Quick Start: Installation](https://lanl.github.io/dsi/installation.html) to set up DSI.\n",
2020
"\n"
@@ -113,7 +113,7 @@
113113
"id": "51584519-2e77-4afa-983a-f69945a084c3",
114114
"metadata": {},
115115
"source": [
116-
"# Exploring the loaded data"
116+
"# Exploring the loaded metadata"
117117
]
118118
},
119119
{
@@ -165,7 +165,7 @@
165165
"id": "b59cddcd-5a83-4fa3-8f4e-fd5d98381aa6",
166166
"metadata": {},
167167
"source": [
168-
"# DSI Find to search within the data\n",
168+
"# DSI Find to search within the metadata\n",
169169
"\n",
170170
"DSI's find capability lets you explore your data by performing queries with the following modifiers, such as >, <, >=, <=, =, ==, ~ (contains), ~~ (contains), !=, and (X, Y) for a range between values X and Y. Additionally, by adding a \"True\" input will return you a collection."
171171
]
@@ -250,7 +250,7 @@
250250
"source": [
251251
"# Query DSI\n",
252252
"\n",
253-
"DSI Supports direct SQL queries to the data that you have ingested"
253+
"DSI Supports direct SQL queries to the metadata that you have ingested"
254254
]
255255
},
256256
{
@@ -303,8 +303,14 @@
303303
"metadata": {},
304304
"source": [
305305
"{\n",
306+
" \"genesis_datacard\": {\n",
307+
" \"primary_key\": \"Title\"\n",
308+
" },\n",
306309
" \"simulation\": {\n",
307-
" \"primary_key\": \"sim_id\"\n",
310+
" \"primary_key\": \"sim_id\",\n",
311+
" \"foreign_key\": {\n",
312+
" \"dataset\": [\"genesis_datacard\", \"Title\"]\n",
313+
" }\n",
308314
" }, \n",
309315
" \"input\": {\n",
310316
" \"foreign_key\": {\n",
@@ -365,9 +371,11 @@
365371
]
366372
},
367373
{
368-
"cell_type": "raw",
369-
"id": "e145ba60-4f5b-4cb3-99e0-239f56794b56",
374+
"cell_type": "code",
375+
"execution_count": null,
376+
"id": "18d62564-30f0-45af-b664-30f1862b32d9",
370377
"metadata": {},
378+
"outputs": [],
371379
"source": [
372380
"store.write(\"clover_er_diagram_no_schema.png\", \"ER_Diagram\")\n",
373381
"\n",
@@ -386,15 +394,15 @@
386394
"schema_store = DSI(\"diana_schema_tutorial.db\")\n",
387395
"\n",
388396
"# dsi.schema(filename)\n",
389-
"schema_store.schema(\"./clover3d/schema.json\") # Schema neeeds to be defined before reading Cloverleaf data\n",
390-
"\n",
391-
"# Read in Datacard (Tier 1)\n",
392-
"store.read(\"clover3d/genesis_datacard.xlsx\", 'GenesisDatacard')\n",
397+
"schema_store.schema(\"./clover3d/schema2.json\") # Schema neeeds to be defined before reading Cloverleaf data\n",
393398
"\n",
394399
"# Read in Tier 2 and Tier 3 metadata\n",
395400
"# dsi.read(path, reader)\n",
396401
"schema_store.read(\"./clover3d/\", 'Cloverleaf')\n",
397402
"\n",
403+
"# Read in Datacard (Tier 1)\n",
404+
"schema_store.read(\"clover3d/genesis_datacard.xlsx\", 'GenesisDatacard')\n",
405+
"\n",
398406
"# dsi.write(filename, writer)\n",
399407
"schema_store.write(\"clover_er_diagram.png\", \"ER_Diagram\")"
400408
]
@@ -425,7 +433,7 @@
425433
"source": [
426434
"# DSI Write - CSV\n",
427435
"\n",
428-
"DSI Support the output (write) of data if you would like to export into another project. For example, here we want to export the table \"input\" into a csv file."
436+
"DSI Support the output (write) of metadata if you would like to export into another project. For example, here we want to export the table \"input\" into a csv file."
429437
]
430438
},
431439
{
@@ -490,7 +498,7 @@
490498
"id": "8140e5fb-8932-434b-852b-a9944259024f",
491499
"metadata": {},
492500
"source": [
493-
"# Moving your data with DSI"
501+
"# Moving your data and metadata with DSI"
494502
]
495503
},
496504
{

0 commit comments

Comments
 (0)