lamindb 1.0.4__py3-none-any.whl → 1.1.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.
Files changed (78) hide show
  1. lamindb/__init__.py +14 -5
  2. lamindb/_artifact.py +174 -57
  3. lamindb/_can_curate.py +27 -8
  4. lamindb/_collection.py +85 -51
  5. lamindb/_feature.py +177 -41
  6. lamindb/_finish.py +222 -81
  7. lamindb/_from_values.py +83 -98
  8. lamindb/_parents.py +4 -4
  9. lamindb/_query_set.py +59 -17
  10. lamindb/_record.py +171 -53
  11. lamindb/_run.py +4 -4
  12. lamindb/_save.py +33 -10
  13. lamindb/_schema.py +135 -38
  14. lamindb/_storage.py +1 -1
  15. lamindb/_tracked.py +106 -0
  16. lamindb/_transform.py +21 -8
  17. lamindb/_ulabel.py +5 -14
  18. lamindb/base/validation.py +2 -6
  19. lamindb/core/__init__.py +13 -14
  20. lamindb/core/_context.py +39 -36
  21. lamindb/core/_data.py +29 -25
  22. lamindb/core/_describe.py +1 -1
  23. lamindb/core/_django.py +1 -1
  24. lamindb/core/_feature_manager.py +54 -44
  25. lamindb/core/_label_manager.py +4 -4
  26. lamindb/core/_mapped_collection.py +20 -7
  27. lamindb/core/datasets/__init__.py +6 -1
  28. lamindb/core/datasets/_core.py +12 -11
  29. lamindb/core/datasets/_small.py +66 -20
  30. lamindb/core/exceptions.py +1 -90
  31. lamindb/core/loaders.py +7 -13
  32. lamindb/core/relations.py +6 -4
  33. lamindb/core/storage/_anndata_accessor.py +41 -0
  34. lamindb/core/storage/_backed_access.py +2 -2
  35. lamindb/core/storage/_pyarrow_dataset.py +25 -15
  36. lamindb/core/storage/_tiledbsoma.py +56 -12
  37. lamindb/core/storage/paths.py +41 -22
  38. lamindb/core/subsettings/_creation_settings.py +4 -16
  39. lamindb/curators/__init__.py +2168 -833
  40. lamindb/curators/_cellxgene_schemas/__init__.py +26 -0
  41. lamindb/curators/_cellxgene_schemas/schema_versions.yml +104 -0
  42. lamindb/errors.py +96 -0
  43. lamindb/integrations/_vitessce.py +3 -3
  44. lamindb/migrations/0069_squashed.py +76 -75
  45. lamindb/migrations/0075_lamindbv1_part5.py +4 -5
  46. lamindb/migrations/0082_alter_feature_dtype.py +21 -0
  47. lamindb/migrations/0083_alter_feature_is_type_alter_flextable_is_type_and_more.py +94 -0
  48. lamindb/migrations/0084_alter_schemafeature_feature_and_more.py +35 -0
  49. lamindb/migrations/0085_alter_feature_is_type_alter_flextable_is_type_and_more.py +63 -0
  50. lamindb/migrations/0086_various.py +95 -0
  51. lamindb/migrations/0087_rename__schemas_m2m_artifact_feature_sets_and_more.py +41 -0
  52. lamindb/migrations/0088_schema_components.py +273 -0
  53. lamindb/migrations/0088_squashed.py +4372 -0
  54. lamindb/models.py +423 -156
  55. {lamindb-1.0.4.dist-info → lamindb-1.1.0.dist-info}/METADATA +10 -7
  56. lamindb-1.1.0.dist-info/RECORD +95 -0
  57. lamindb/curators/_spatial.py +0 -528
  58. lamindb/migrations/0052_squashed.py +0 -1261
  59. lamindb/migrations/0053_alter_featureset_hash_alter_paramvalue_created_by_and_more.py +0 -57
  60. lamindb/migrations/0054_alter_feature_previous_runs_and_more.py +0 -35
  61. lamindb/migrations/0055_artifact_type_artifactparamvalue_and_more.py +0 -61
  62. lamindb/migrations/0056_rename_ulabel_ref_is_name_artifactulabel_label_ref_is_name_and_more.py +0 -22
  63. lamindb/migrations/0057_link_models_latest_report_and_others.py +0 -356
  64. lamindb/migrations/0058_artifact__actions_collection__actions.py +0 -22
  65. lamindb/migrations/0059_alter_artifact__accessor_alter_artifact__hash_type_and_more.py +0 -31
  66. lamindb/migrations/0060_alter_artifact__actions.py +0 -22
  67. lamindb/migrations/0061_alter_collection_meta_artifact_alter_run_environment_and_more.py +0 -45
  68. lamindb/migrations/0062_add_is_latest_field.py +0 -32
  69. lamindb/migrations/0063_populate_latest_field.py +0 -45
  70. lamindb/migrations/0064_alter_artifact_version_alter_collection_version_and_more.py +0 -33
  71. lamindb/migrations/0065_remove_collection_feature_sets_and_more.py +0 -22
  72. lamindb/migrations/0066_alter_artifact__feature_values_and_more.py +0 -352
  73. lamindb/migrations/0067_alter_featurevalue_unique_together_and_more.py +0 -20
  74. lamindb/migrations/0068_alter_artifactulabel_unique_together_and_more.py +0 -20
  75. lamindb/migrations/0069_alter_artifact__accessor_alter_artifact__hash_type_and_more.py +0 -1294
  76. lamindb-1.0.4.dist-info/RECORD +0 -102
  77. {lamindb-1.0.4.dist-info → lamindb-1.1.0.dist-info}/LICENSE +0 -0
  78. {lamindb-1.0.4.dist-info → lamindb-1.1.0.dist-info}/WHEEL +0 -0
@@ -1,1261 +0,0 @@
1
- # Generated by Django 5.0.6 on 2024-05-19 11:58
2
-
3
- import django.db.models.deletion
4
- from django.db import migrations, models
5
-
6
- import lamindb.base.ids
7
- import lamindb.base.types
8
- import lamindb.base.users
9
- import lamindb.models
10
-
11
-
12
- class Migration(migrations.Migration):
13
- initial = True
14
- dependencies = [] # type: ignore
15
-
16
- operations = [
17
- migrations.CreateModel(
18
- name="Artifact",
19
- fields=[
20
- (
21
- "version",
22
- models.CharField(
23
- db_index=True, default=None, max_length=10, null=True
24
- ),
25
- ),
26
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
27
- ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
28
- ("id", models.AutoField(primary_key=True, serialize=False)),
29
- ("uid", models.CharField(db_index=True, max_length=20, unique=True)),
30
- (
31
- "key",
32
- models.CharField(
33
- db_index=True, default=None, max_length=255, null=True
34
- ),
35
- ),
36
- (
37
- "suffix",
38
- models.CharField(db_index=True, default=None, max_length=30),
39
- ),
40
- (
41
- "accessor",
42
- models.CharField(
43
- db_index=True, default=None, max_length=64, null=True
44
- ),
45
- ),
46
- (
47
- "description",
48
- models.CharField(
49
- db_index=True, default=None, max_length=255, null=True
50
- ),
51
- ),
52
- ("size", models.BigIntegerField(db_index=True, null=True)),
53
- (
54
- "hash",
55
- models.CharField(
56
- db_index=True, default=None, max_length=86, null=True
57
- ),
58
- ),
59
- (
60
- "hash_type",
61
- models.CharField(
62
- db_index=True, default=None, max_length=30, null=True
63
- ),
64
- ),
65
- (
66
- "n_objects",
67
- models.BigIntegerField(db_index=True, default=None, null=True),
68
- ),
69
- (
70
- "n_observations",
71
- models.BigIntegerField(db_index=True, default=None, null=True),
72
- ),
73
- (
74
- "visibility",
75
- models.SmallIntegerField(
76
- choices=[(1, "Default"), (0, "Hidden"), (-1, "Trash")],
77
- db_index=True,
78
- default=1,
79
- ),
80
- ),
81
- ("key_is_virtual", models.BooleanField()),
82
- ],
83
- options={
84
- "abstract": False,
85
- },
86
- ),
87
- migrations.CreateModel(
88
- name="Feature",
89
- fields=[
90
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
91
- ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
92
- ("id", models.AutoField(primary_key=True, serialize=False)),
93
- (
94
- "uid",
95
- models.CharField(
96
- db_index=True,
97
- default=lamindb.base.ids.base62_12,
98
- max_length=12,
99
- unique=True,
100
- ),
101
- ),
102
- ("name", models.CharField(db_index=True, default=None, max_length=150)),
103
- ("dtype", models.CharField(db_index=True, default=None, max_length=64)),
104
- (
105
- "unit",
106
- models.CharField(
107
- db_index=True, default=None, max_length=30, null=True
108
- ),
109
- ),
110
- (
111
- "description",
112
- models.TextField(db_index=True, default=None, null=True),
113
- ),
114
- ("synonyms", models.TextField(default=None, null=True)),
115
- ],
116
- options={
117
- "abstract": False,
118
- },
119
- bases=(lamindb.models.CanCurate, models.Model),
120
- ),
121
- migrations.CreateModel(
122
- name="FeatureSet",
123
- fields=[
124
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
125
- ("id", models.AutoField(primary_key=True, serialize=False)),
126
- (
127
- "uid",
128
- models.CharField(
129
- db_index=True, default=None, max_length=20, unique=True
130
- ),
131
- ),
132
- ("name", models.CharField(default=None, max_length=150, null=True)),
133
- ("n", models.IntegerField()),
134
- ("dtype", models.CharField(default=None, max_length=64, null=True)),
135
- ("registry", models.CharField(db_index=True, max_length=120)),
136
- (
137
- "hash",
138
- models.CharField(
139
- db_index=True, default=None, max_length=20, null=True
140
- ),
141
- ),
142
- ],
143
- options={
144
- "abstract": False,
145
- },
146
- ),
147
- migrations.CreateModel(
148
- name="Param",
149
- fields=[
150
- (
151
- "id",
152
- models.BigAutoField(
153
- auto_created=True,
154
- primary_key=True,
155
- serialize=False,
156
- verbose_name="ID",
157
- ),
158
- ),
159
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
160
- ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
161
- ("name", models.CharField(db_index=True, max_length=100)),
162
- ("dtype", models.CharField(db_index=True, default=None, max_length=64)),
163
- ],
164
- options={
165
- "abstract": False,
166
- },
167
- ),
168
- migrations.CreateModel(
169
- name="User",
170
- fields=[
171
- ("id", models.AutoField(primary_key=True, serialize=False)),
172
- (
173
- "uid",
174
- models.CharField(
175
- db_index=True, default=None, max_length=8, unique=True
176
- ),
177
- ),
178
- (
179
- "handle",
180
- models.CharField(
181
- db_index=True, default=None, max_length=30, unique=True
182
- ),
183
- ),
184
- (
185
- "name",
186
- models.CharField(
187
- db_index=True, default=None, max_length=150, null=True
188
- ),
189
- ),
190
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
191
- ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
192
- ],
193
- options={
194
- "abstract": False,
195
- },
196
- bases=(models.Model, lamindb.models.CanCurate),
197
- ),
198
- migrations.CreateModel(
199
- name="Collection",
200
- fields=[
201
- (
202
- "version",
203
- models.CharField(
204
- db_index=True, default=None, max_length=10, null=True
205
- ),
206
- ),
207
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
208
- ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
209
- ("id", models.AutoField(primary_key=True, serialize=False)),
210
- (
211
- "uid",
212
- models.CharField(
213
- db_index=True,
214
- default=lamindb.base.ids.base62_20,
215
- max_length=20,
216
- unique=True,
217
- ),
218
- ),
219
- ("name", models.CharField(db_index=True, default=None, max_length=150)),
220
- ("description", models.TextField(default=None, null=True)),
221
- (
222
- "hash",
223
- models.CharField(
224
- db_index=True, default=None, max_length=86, null=True
225
- ),
226
- ),
227
- (
228
- "reference",
229
- models.CharField(
230
- db_index=True, default=None, max_length=255, null=True
231
- ),
232
- ),
233
- (
234
- "reference_type",
235
- models.CharField(
236
- db_index=True, default=None, max_length=25, null=True
237
- ),
238
- ),
239
- (
240
- "visibility",
241
- models.SmallIntegerField(
242
- choices=[(1, "Default"), (0, "Hidden"), (-1, "Trash")],
243
- db_index=True,
244
- default=1,
245
- ),
246
- ),
247
- (
248
- "artifact",
249
- models.OneToOneField(
250
- null=True,
251
- on_delete=django.db.models.deletion.PROTECT,
252
- related_name="collection",
253
- to="lamindb.artifact",
254
- ),
255
- ),
256
- ],
257
- options={
258
- "abstract": False,
259
- },
260
- ),
261
- migrations.CreateModel(
262
- name="CollectionArtifact",
263
- fields=[
264
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
265
- ("id", models.BigAutoField(primary_key=True, serialize=False)),
266
- (
267
- "artifact",
268
- models.ForeignKey(
269
- on_delete=django.db.models.deletion.PROTECT,
270
- related_name="collection_links",
271
- to="lamindb.artifact",
272
- ),
273
- ),
274
- (
275
- "collection",
276
- models.ForeignKey(
277
- on_delete=django.db.models.deletion.CASCADE,
278
- related_name="artifact_links",
279
- to="lamindb.collection",
280
- ),
281
- ),
282
- ],
283
- bases=(lamindb.models.LinkORM, models.Model),
284
- ),
285
- migrations.AddField(
286
- model_name="collection",
287
- name="unordered_artifacts",
288
- field=models.ManyToManyField(
289
- related_name="collections",
290
- through="lamindb.CollectionArtifact",
291
- to="lamindb.artifact",
292
- ),
293
- ),
294
- migrations.CreateModel(
295
- name="CollectionFeatureSet",
296
- fields=[
297
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
298
- ("id", models.BigAutoField(primary_key=True, serialize=False)),
299
- ("slot", models.CharField(default=None, max_length=50, null=True)),
300
- (
301
- "feature_ref_is_semantic",
302
- models.BooleanField(default=None, null=True),
303
- ),
304
- (
305
- "collection",
306
- models.ForeignKey(
307
- on_delete=django.db.models.deletion.CASCADE,
308
- related_name="feature_set_links",
309
- to="lamindb.collection",
310
- ),
311
- ),
312
- (
313
- "featureset",
314
- models.ForeignKey(
315
- on_delete=django.db.models.deletion.PROTECT,
316
- related_name="collection_links",
317
- to="lamindb.featureset",
318
- ),
319
- ),
320
- ],
321
- bases=(lamindb.models.LinkORM, models.Model),
322
- ),
323
- migrations.AddField(
324
- model_name="collection",
325
- name="feature_sets",
326
- field=models.ManyToManyField(
327
- related_name="collections",
328
- through="lamindb.CollectionFeatureSet",
329
- to="lamindb.featureset",
330
- ),
331
- ),
332
- migrations.CreateModel(
333
- name="ArtifactFeatureSet",
334
- fields=[
335
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
336
- ("id", models.BigAutoField(primary_key=True, serialize=False)),
337
- ("slot", models.CharField(default=None, max_length=40, null=True)),
338
- (
339
- "feature_ref_is_semantic",
340
- models.BooleanField(default=None, null=True),
341
- ),
342
- (
343
- "artifact",
344
- models.ForeignKey(
345
- on_delete=django.db.models.deletion.CASCADE,
346
- related_name="feature_set_links",
347
- to="lamindb.artifact",
348
- ),
349
- ),
350
- (
351
- "featureset",
352
- models.ForeignKey(
353
- on_delete=django.db.models.deletion.PROTECT,
354
- related_name="artifact_links",
355
- to="lamindb.featureset",
356
- ),
357
- ),
358
- ],
359
- bases=(lamindb.models.LinkORM, models.Model),
360
- ),
361
- migrations.AddField(
362
- model_name="artifact",
363
- name="feature_sets",
364
- field=models.ManyToManyField(
365
- related_name="artifacts",
366
- through="lamindb.ArtifactFeatureSet",
367
- to="lamindb.featureset",
368
- ),
369
- ),
370
- migrations.CreateModel(
371
- name="FeatureSetFeature",
372
- fields=[
373
- ("id", models.BigAutoField(primary_key=True, serialize=False)),
374
- (
375
- "feature",
376
- models.ForeignKey(
377
- on_delete=django.db.models.deletion.PROTECT,
378
- related_name="+",
379
- to="lamindb.feature",
380
- ),
381
- ),
382
- (
383
- "featureset",
384
- models.ForeignKey(
385
- on_delete=django.db.models.deletion.CASCADE,
386
- related_name="+",
387
- to="lamindb.featureset",
388
- ),
389
- ),
390
- ],
391
- options={
392
- "abstract": False,
393
- },
394
- bases=(models.Model, lamindb.models.LinkORM),
395
- ),
396
- migrations.AddField(
397
- model_name="feature",
398
- name="feature_sets",
399
- field=models.ManyToManyField(
400
- related_name="features",
401
- through="lamindb.FeatureSetFeature",
402
- to="lamindb.featureset",
403
- ),
404
- ),
405
- migrations.CreateModel(
406
- name="FeatureValue",
407
- fields=[
408
- (
409
- "id",
410
- models.BigAutoField(
411
- auto_created=True,
412
- primary_key=True,
413
- serialize=False,
414
- verbose_name="ID",
415
- ),
416
- ),
417
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
418
- ("value", models.JSONField()),
419
- (
420
- "feature",
421
- models.ForeignKey(
422
- default=None,
423
- null=True,
424
- on_delete=django.db.models.deletion.CASCADE,
425
- to="lamindb.feature",
426
- ),
427
- ),
428
- ],
429
- options={
430
- "abstract": False,
431
- },
432
- ),
433
- migrations.CreateModel(
434
- name="ArtifactFeatureValue",
435
- fields=[
436
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
437
- ("id", models.BigAutoField(primary_key=True, serialize=False)),
438
- (
439
- "artifact",
440
- models.ForeignKey(
441
- on_delete=django.db.models.deletion.CASCADE,
442
- related_name="+",
443
- to="lamindb.artifact",
444
- ),
445
- ),
446
- (
447
- "featurevalue",
448
- models.ForeignKey(
449
- on_delete=django.db.models.deletion.PROTECT,
450
- related_name="+",
451
- to="lamindb.featurevalue",
452
- ),
453
- ),
454
- ],
455
- bases=(lamindb.models.LinkORM, models.Model),
456
- ),
457
- migrations.AddField(
458
- model_name="artifact",
459
- name="feature_values",
460
- field=models.ManyToManyField(
461
- through="lamindb.ArtifactFeatureValue",
462
- to="lamindb.featurevalue",
463
- ),
464
- ),
465
- migrations.CreateModel(
466
- name="ParamValue",
467
- fields=[
468
- (
469
- "id",
470
- models.BigAutoField(
471
- auto_created=True,
472
- primary_key=True,
473
- serialize=False,
474
- verbose_name="ID",
475
- ),
476
- ),
477
- ("value", models.JSONField()),
478
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
479
- (
480
- "param",
481
- models.ForeignKey(
482
- on_delete=django.db.models.deletion.CASCADE,
483
- to="lamindb.param",
484
- ),
485
- ),
486
- (
487
- "created_by",
488
- models.ForeignKey(
489
- default=lamindb.base.users.current_user_id,
490
- on_delete=django.db.models.deletion.PROTECT,
491
- related_name="created_transforms",
492
- to="lamindb.user",
493
- ),
494
- ),
495
- ],
496
- options={
497
- "abstract": False,
498
- },
499
- ),
500
- migrations.CreateModel(
501
- name="Run",
502
- fields=[
503
- ("id", models.BigAutoField(primary_key=True, serialize=False)),
504
- (
505
- "uid",
506
- models.CharField(
507
- db_index=True,
508
- default=lamindb.base.ids.base62_20,
509
- max_length=20,
510
- unique=True,
511
- ),
512
- ),
513
- ("started_at", models.DateTimeField(auto_now_add=True, db_index=True)),
514
- (
515
- "finished_at",
516
- models.DateTimeField(db_index=True, default=None, null=True),
517
- ),
518
- ("is_consecutive", models.BooleanField(default=None, null=True)),
519
- (
520
- "reference",
521
- models.CharField(
522
- db_index=True, default=None, max_length=255, null=True
523
- ),
524
- ),
525
- (
526
- "reference_type",
527
- models.CharField(
528
- db_index=True, default=None, max_length=25, null=True
529
- ),
530
- ),
531
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
532
- (
533
- "environment",
534
- models.ForeignKey(
535
- default=None,
536
- null=True,
537
- on_delete=django.db.models.deletion.PROTECT,
538
- related_name="environment_of",
539
- to="lamindb.artifact",
540
- ),
541
- ),
542
- (
543
- "report",
544
- models.ForeignKey(
545
- default=None,
546
- null=True,
547
- on_delete=django.db.models.deletion.PROTECT,
548
- related_name="report_of",
549
- to="lamindb.artifact",
550
- ),
551
- ),
552
- ],
553
- options={
554
- "abstract": False,
555
- },
556
- ),
557
- migrations.AddField(
558
- model_name="param",
559
- name="previous_runs",
560
- field=models.ManyToManyField(to="lamindb.run"),
561
- ),
562
- migrations.AddField(
563
- model_name="param",
564
- name="run",
565
- field=models.ForeignKey(
566
- default=lamindb.models.current_run,
567
- null=True,
568
- on_delete=django.db.models.deletion.PROTECT,
569
- to="lamindb.run",
570
- ),
571
- ),
572
- migrations.AddField(
573
- model_name="featurevalue",
574
- name="run",
575
- field=models.ForeignKey(
576
- default=lamindb.models.current_run,
577
- null=True,
578
- on_delete=django.db.models.deletion.PROTECT,
579
- to="lamindb.run",
580
- ),
581
- ),
582
- migrations.AddField(
583
- model_name="featureset",
584
- name="run",
585
- field=models.ForeignKey(
586
- default=lamindb.models.current_run,
587
- null=True,
588
- on_delete=django.db.models.deletion.PROTECT,
589
- to="lamindb.run",
590
- ),
591
- ),
592
- migrations.AddField(
593
- model_name="feature",
594
- name="previous_runs",
595
- field=models.ManyToManyField(to="lamindb.run"),
596
- ),
597
- migrations.AddField(
598
- model_name="feature",
599
- name="run",
600
- field=models.ForeignKey(
601
- default=lamindb.models.current_run,
602
- null=True,
603
- on_delete=django.db.models.deletion.PROTECT,
604
- to="lamindb.run",
605
- ),
606
- ),
607
- migrations.AddField(
608
- model_name="collectionfeatureset",
609
- name="run",
610
- field=models.ForeignKey(
611
- default=lamindb.models.current_run,
612
- null=True,
613
- on_delete=django.db.models.deletion.PROTECT,
614
- to="lamindb.run",
615
- ),
616
- ),
617
- migrations.AddField(
618
- model_name="collectionartifact",
619
- name="run",
620
- field=models.ForeignKey(
621
- default=lamindb.models.current_run,
622
- null=True,
623
- on_delete=django.db.models.deletion.PROTECT,
624
- to="lamindb.run",
625
- ),
626
- ),
627
- migrations.AddField(
628
- model_name="collection",
629
- name="input_of",
630
- field=models.ManyToManyField(
631
- related_name="input_collections", to="lamindb.run"
632
- ),
633
- ),
634
- migrations.AddField(
635
- model_name="collection",
636
- name="previous_runs",
637
- field=models.ManyToManyField(
638
- related_name="output_collections_with_later_updates",
639
- to="lamindb.run",
640
- ),
641
- ),
642
- migrations.AddField(
643
- model_name="collection",
644
- name="run",
645
- field=models.ForeignKey(
646
- default=None,
647
- null=True,
648
- on_delete=django.db.models.deletion.PROTECT,
649
- related_name="output_collections",
650
- to="lamindb.run",
651
- ),
652
- ),
653
- migrations.AddField(
654
- model_name="artifactfeaturevalue",
655
- name="run",
656
- field=models.ForeignKey(
657
- default=lamindb.models.current_run,
658
- null=True,
659
- on_delete=django.db.models.deletion.PROTECT,
660
- to="lamindb.run",
661
- ),
662
- ),
663
- migrations.AddField(
664
- model_name="artifactfeatureset",
665
- name="run",
666
- field=models.ForeignKey(
667
- default=lamindb.models.current_run,
668
- null=True,
669
- on_delete=django.db.models.deletion.PROTECT,
670
- to="lamindb.run",
671
- ),
672
- ),
673
- migrations.AddField(
674
- model_name="artifact",
675
- name="input_of",
676
- field=models.ManyToManyField(
677
- related_name="input_artifacts", to="lamindb.run"
678
- ),
679
- ),
680
- migrations.AddField(
681
- model_name="artifact",
682
- name="previous_runs",
683
- field=models.ManyToManyField(
684
- related_name="output_artifacts_with_later_updates",
685
- to="lamindb.run",
686
- ),
687
- ),
688
- migrations.AddField(
689
- model_name="artifact",
690
- name="run",
691
- field=models.ForeignKey(
692
- default=None,
693
- null=True,
694
- on_delete=django.db.models.deletion.PROTECT,
695
- related_name="output_artifacts",
696
- to="lamindb.run",
697
- ),
698
- ),
699
- migrations.CreateModel(
700
- name="RunParamValue",
701
- fields=[
702
- ("id", models.BigAutoField(primary_key=True, serialize=False)),
703
- (
704
- "paramvalue",
705
- models.ForeignKey(
706
- on_delete=django.db.models.deletion.PROTECT,
707
- related_name="+",
708
- to="lamindb.paramvalue",
709
- ),
710
- ),
711
- (
712
- "run",
713
- models.ForeignKey(
714
- on_delete=django.db.models.deletion.CASCADE,
715
- related_name="+",
716
- to="lamindb.run",
717
- ),
718
- ),
719
- ],
720
- options={
721
- "unique_together": {("run", "paramvalue")},
722
- },
723
- bases=(models.Model, lamindb.models.LinkORM),
724
- ),
725
- migrations.AddField(
726
- model_name="run",
727
- name="param_values",
728
- field=models.ManyToManyField(
729
- related_name="runs",
730
- through="lamindb.RunParamValue",
731
- to="lamindb.paramvalue",
732
- ),
733
- ),
734
- migrations.CreateModel(
735
- name="Storage",
736
- fields=[
737
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
738
- ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
739
- ("id", models.AutoField(primary_key=True, serialize=False)),
740
- (
741
- "uid",
742
- models.CharField(
743
- db_index=True,
744
- default=lamindb.base.ids.base62_12,
745
- max_length=12,
746
- unique=True,
747
- ),
748
- ),
749
- (
750
- "root",
751
- models.CharField(
752
- db_index=True, default=None, max_length=255, unique=True
753
- ),
754
- ),
755
- (
756
- "description",
757
- models.CharField(
758
- db_index=True, default=None, max_length=255, null=True
759
- ),
760
- ),
761
- ("type", models.CharField(db_index=True, max_length=30)),
762
- (
763
- "region",
764
- models.CharField(
765
- db_index=True, default=None, max_length=64, null=True
766
- ),
767
- ),
768
- (
769
- "instance_uid",
770
- models.CharField(
771
- db_index=True, default=None, max_length=12, null=True
772
- ),
773
- ),
774
- ("previous_runs", models.ManyToManyField(to="lamindb.run")),
775
- (
776
- "run",
777
- models.ForeignKey(
778
- default=lamindb.models.current_run,
779
- null=True,
780
- on_delete=django.db.models.deletion.PROTECT,
781
- to="lamindb.run",
782
- ),
783
- ),
784
- (
785
- "created_by",
786
- models.ForeignKey(
787
- default=lamindb.base.users.current_user_id,
788
- on_delete=django.db.models.deletion.PROTECT,
789
- to="lamindb.user",
790
- ),
791
- ),
792
- ],
793
- options={
794
- "abstract": False,
795
- },
796
- ),
797
- migrations.AddField(
798
- model_name="artifact",
799
- name="storage",
800
- field=models.ForeignKey(
801
- on_delete=django.db.models.deletion.PROTECT,
802
- related_name="artifacts",
803
- to="lamindb.storage",
804
- ),
805
- ),
806
- migrations.CreateModel(
807
- name="Transform",
808
- fields=[
809
- (
810
- "version",
811
- models.CharField(
812
- db_index=True, default=None, max_length=10, null=True
813
- ),
814
- ),
815
- ("id", models.AutoField(primary_key=True, serialize=False)),
816
- (
817
- "uid",
818
- models.CharField(
819
- db_index=True, default=None, max_length=16, unique=True
820
- ),
821
- ),
822
- (
823
- "name",
824
- models.CharField(
825
- db_index=True, default=None, max_length=150, null=True
826
- ),
827
- ),
828
- (
829
- "key",
830
- models.CharField(
831
- db_index=True, default=None, max_length=120, null=True
832
- ),
833
- ),
834
- (
835
- "description",
836
- models.CharField(default=None, max_length=255, null=True),
837
- ),
838
- (
839
- "type",
840
- models.CharField(
841
- choices=[
842
- ("pipeline", "pipeline"),
843
- ("notebook", "notebook"),
844
- ("upload", "upload"),
845
- ("script", "script"),
846
- ("function", "function"),
847
- ],
848
- db_index=True,
849
- default="pipeline",
850
- max_length=20,
851
- ),
852
- ),
853
- (
854
- "reference",
855
- models.CharField(
856
- db_index=True, default=None, max_length=255, null=True
857
- ),
858
- ),
859
- (
860
- "reference_type",
861
- models.CharField(
862
- db_index=True, default=None, max_length=25, null=True
863
- ),
864
- ),
865
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
866
- ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
867
- (
868
- "latest_report",
869
- models.ForeignKey(
870
- default=None,
871
- null=True,
872
- on_delete=django.db.models.deletion.PROTECT,
873
- related_name="latest_report_of",
874
- to="lamindb.artifact",
875
- ),
876
- ),
877
- (
878
- "parents",
879
- models.ManyToManyField(
880
- related_name="children", to="lamindb.transform"
881
- ),
882
- ),
883
- (
884
- "source_code",
885
- models.ForeignKey(
886
- default=None,
887
- null=True,
888
- on_delete=django.db.models.deletion.PROTECT,
889
- related_name="source_code_of",
890
- to="lamindb.artifact",
891
- ),
892
- ),
893
- ],
894
- options={
895
- "abstract": False,
896
- },
897
- bases=(lamindb.models.HasParents, models.Model),
898
- ),
899
- migrations.AddField(
900
- model_name="run",
901
- name="transform",
902
- field=models.ForeignKey(
903
- on_delete=django.db.models.deletion.CASCADE,
904
- related_name="runs",
905
- to="lamindb.transform",
906
- ),
907
- ),
908
- migrations.AddField(
909
- model_name="collection",
910
- name="transform",
911
- field=models.ForeignKey(
912
- default=None,
913
- null=True,
914
- on_delete=django.db.models.deletion.PROTECT,
915
- related_name="output_collections",
916
- to="lamindb.transform",
917
- ),
918
- ),
919
- migrations.AddField(
920
- model_name="artifact",
921
- name="transform",
922
- field=models.ForeignKey(
923
- default=None,
924
- null=True,
925
- on_delete=django.db.models.deletion.PROTECT,
926
- related_name="output_artifacts",
927
- to="lamindb.transform",
928
- ),
929
- ),
930
- migrations.CreateModel(
931
- name="ULabel",
932
- fields=[
933
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
934
- ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
935
- ("id", models.AutoField(primary_key=True, serialize=False)),
936
- (
937
- "uid",
938
- models.CharField(
939
- db_index=True,
940
- default=lamindb.base.ids.base62_8,
941
- max_length=8,
942
- unique=True,
943
- ),
944
- ),
945
- (
946
- "name",
947
- models.CharField(
948
- db_index=True, default=None, max_length=150, unique=True
949
- ),
950
- ),
951
- ("description", models.TextField(default=None, null=True)),
952
- (
953
- "reference",
954
- models.CharField(
955
- db_index=True, default=None, max_length=255, null=True
956
- ),
957
- ),
958
- (
959
- "reference_type",
960
- models.CharField(
961
- db_index=True, default=None, max_length=25, null=True
962
- ),
963
- ),
964
- (
965
- "parents",
966
- models.ManyToManyField(
967
- related_name="children", to="lamindb.ulabel"
968
- ),
969
- ),
970
- ("previous_runs", models.ManyToManyField(to="lamindb.run")),
971
- (
972
- "run",
973
- models.ForeignKey(
974
- default=lamindb.models.current_run,
975
- null=True,
976
- on_delete=django.db.models.deletion.PROTECT,
977
- to="lamindb.run",
978
- ),
979
- ),
980
- (
981
- "created_by",
982
- models.ForeignKey(
983
- default=lamindb.base.users.current_user_id,
984
- on_delete=django.db.models.deletion.PROTECT,
985
- to="lamindb.user",
986
- ),
987
- ),
988
- ],
989
- options={
990
- "abstract": False,
991
- },
992
- bases=(
993
- lamindb.models.HasParents,
994
- lamindb.models.CanCurate,
995
- models.Model,
996
- ),
997
- ),
998
- migrations.AddField(
999
- model_name="transform",
1000
- name="ulabels",
1001
- field=models.ManyToManyField(
1002
- related_name="transforms", to="lamindb.ulabel"
1003
- ),
1004
- ),
1005
- migrations.CreateModel(
1006
- name="CollectionULabel",
1007
- fields=[
1008
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
1009
- ("id", models.BigAutoField(primary_key=True, serialize=False)),
1010
- ("ulabel_ref_is_name", models.BooleanField(default=None, null=True)),
1011
- ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
1012
- (
1013
- "collection",
1014
- models.ForeignKey(
1015
- on_delete=django.db.models.deletion.CASCADE,
1016
- related_name="ulabel_links",
1017
- to="lamindb.collection",
1018
- ),
1019
- ),
1020
- (
1021
- "feature",
1022
- models.ForeignKey(
1023
- default=None,
1024
- null=True,
1025
- on_delete=django.db.models.deletion.PROTECT,
1026
- related_name="collectionulabel_links",
1027
- to="lamindb.feature",
1028
- ),
1029
- ),
1030
- (
1031
- "run",
1032
- models.ForeignKey(
1033
- default=lamindb.models.current_run,
1034
- null=True,
1035
- on_delete=django.db.models.deletion.PROTECT,
1036
- to="lamindb.run",
1037
- ),
1038
- ),
1039
- (
1040
- "ulabel",
1041
- models.ForeignKey(
1042
- on_delete=django.db.models.deletion.PROTECT,
1043
- related_name="collection_links",
1044
- to="lamindb.ulabel",
1045
- ),
1046
- ),
1047
- (
1048
- "created_by",
1049
- models.ForeignKey(
1050
- default=lamindb.base.users.current_user_id,
1051
- on_delete=django.db.models.deletion.PROTECT,
1052
- to="lamindb.user",
1053
- ),
1054
- ),
1055
- ],
1056
- options={
1057
- "unique_together": {("collection", "ulabel")},
1058
- },
1059
- bases=(lamindb.models.LinkORM, models.Model),
1060
- ),
1061
- migrations.AddField(
1062
- model_name="collection",
1063
- name="ulabels",
1064
- field=models.ManyToManyField(
1065
- related_name="collections",
1066
- through="lamindb.CollectionULabel",
1067
- to="lamindb.ulabel",
1068
- ),
1069
- ),
1070
- migrations.CreateModel(
1071
- name="ArtifactULabel",
1072
- fields=[
1073
- ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
1074
- ("id", models.BigAutoField(primary_key=True, serialize=False)),
1075
- ("ulabel_ref_is_name", models.BooleanField(default=None, null=True)),
1076
- ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
1077
- (
1078
- "artifact",
1079
- models.ForeignKey(
1080
- on_delete=django.db.models.deletion.CASCADE,
1081
- related_name="ulabel_links",
1082
- to="lamindb.artifact",
1083
- ),
1084
- ),
1085
- (
1086
- "feature",
1087
- models.ForeignKey(
1088
- default=None,
1089
- null=True,
1090
- on_delete=django.db.models.deletion.PROTECT,
1091
- related_name="artifactulabel_links",
1092
- to="lamindb.feature",
1093
- ),
1094
- ),
1095
- (
1096
- "run",
1097
- models.ForeignKey(
1098
- default=lamindb.models.current_run,
1099
- null=True,
1100
- on_delete=django.db.models.deletion.PROTECT,
1101
- to="lamindb.run",
1102
- ),
1103
- ),
1104
- (
1105
- "ulabel",
1106
- models.ForeignKey(
1107
- on_delete=django.db.models.deletion.PROTECT,
1108
- related_name="artifact_links",
1109
- to="lamindb.ulabel",
1110
- ),
1111
- ),
1112
- (
1113
- "created_by",
1114
- models.ForeignKey(
1115
- default=lamindb.base.users.current_user_id,
1116
- on_delete=django.db.models.deletion.PROTECT,
1117
- to="lamindb.user",
1118
- ),
1119
- ),
1120
- ],
1121
- options={
1122
- "unique_together": {("artifact", "ulabel")},
1123
- },
1124
- bases=(lamindb.models.LinkORM, models.Model),
1125
- ),
1126
- migrations.AddField(
1127
- model_name="artifact",
1128
- name="ulabels",
1129
- field=models.ManyToManyField(
1130
- related_name="artifacts",
1131
- through="lamindb.ArtifactULabel",
1132
- to="lamindb.ulabel",
1133
- ),
1134
- ),
1135
- migrations.AddField(
1136
- model_name="transform",
1137
- name="created_by",
1138
- field=models.ForeignKey(
1139
- default=lamindb.base.users.current_user_id,
1140
- on_delete=django.db.models.deletion.PROTECT,
1141
- related_name="created_transforms",
1142
- to="lamindb.user",
1143
- ),
1144
- ),
1145
- migrations.AddField(
1146
- model_name="run",
1147
- name="created_by",
1148
- field=models.ForeignKey(
1149
- default=lamindb.base.users.current_user_id,
1150
- on_delete=django.db.models.deletion.CASCADE,
1151
- related_name="created_runs",
1152
- to="lamindb.user",
1153
- ),
1154
- ),
1155
- migrations.AddField(
1156
- model_name="param",
1157
- name="created_by",
1158
- field=models.ForeignKey(
1159
- default=lamindb.base.users.current_user_id,
1160
- on_delete=django.db.models.deletion.PROTECT,
1161
- to="lamindb.user",
1162
- ),
1163
- ),
1164
- migrations.AddField(
1165
- model_name="featurevalue",
1166
- name="created_by",
1167
- field=models.ForeignKey(
1168
- default=lamindb.base.users.current_user_id,
1169
- on_delete=django.db.models.deletion.PROTECT,
1170
- to="lamindb.user",
1171
- ),
1172
- ),
1173
- migrations.AddField(
1174
- model_name="featureset",
1175
- name="created_by",
1176
- field=models.ForeignKey(
1177
- default=lamindb.base.users.current_user_id,
1178
- on_delete=django.db.models.deletion.PROTECT,
1179
- to="lamindb.user",
1180
- ),
1181
- ),
1182
- migrations.AddField(
1183
- model_name="feature",
1184
- name="created_by",
1185
- field=models.ForeignKey(
1186
- default=lamindb.base.users.current_user_id,
1187
- on_delete=django.db.models.deletion.PROTECT,
1188
- to="lamindb.user",
1189
- ),
1190
- ),
1191
- migrations.AddField(
1192
- model_name="collectionfeatureset",
1193
- name="created_by",
1194
- field=models.ForeignKey(
1195
- default=lamindb.base.users.current_user_id,
1196
- on_delete=django.db.models.deletion.PROTECT,
1197
- to="lamindb.user",
1198
- ),
1199
- ),
1200
- migrations.AddField(
1201
- model_name="collectionartifact",
1202
- name="created_by",
1203
- field=models.ForeignKey(
1204
- default=lamindb.base.users.current_user_id,
1205
- on_delete=django.db.models.deletion.PROTECT,
1206
- to="lamindb.user",
1207
- ),
1208
- ),
1209
- migrations.AddField(
1210
- model_name="collection",
1211
- name="created_by",
1212
- field=models.ForeignKey(
1213
- default=lamindb.base.users.current_user_id,
1214
- on_delete=django.db.models.deletion.PROTECT,
1215
- to="lamindb.user",
1216
- ),
1217
- ),
1218
- migrations.AddField(
1219
- model_name="artifactfeaturevalue",
1220
- name="created_by",
1221
- field=models.ForeignKey(
1222
- default=lamindb.base.users.current_user_id,
1223
- on_delete=django.db.models.deletion.PROTECT,
1224
- to="lamindb.user",
1225
- ),
1226
- ),
1227
- migrations.AddField(
1228
- model_name="artifactfeatureset",
1229
- name="created_by",
1230
- field=models.ForeignKey(
1231
- default=lamindb.base.users.current_user_id,
1232
- on_delete=django.db.models.deletion.PROTECT,
1233
- to="lamindb.user",
1234
- ),
1235
- ),
1236
- migrations.AddField(
1237
- model_name="artifact",
1238
- name="created_by",
1239
- field=models.ForeignKey(
1240
- default=lamindb.base.users.current_user_id,
1241
- on_delete=django.db.models.deletion.PROTECT,
1242
- to="lamindb.user",
1243
- ),
1244
- ),
1245
- migrations.AlterUniqueTogether(
1246
- name="collectionfeatureset",
1247
- unique_together={("collection", "featureset")},
1248
- ),
1249
- migrations.AlterUniqueTogether(
1250
- name="collectionartifact",
1251
- unique_together={("collection", "artifact")},
1252
- ),
1253
- migrations.AlterUniqueTogether(
1254
- name="artifactfeaturevalue",
1255
- unique_together={("artifact", "featurevalue")},
1256
- ),
1257
- migrations.AlterUniqueTogether(
1258
- name="artifactfeatureset",
1259
- unique_together={("artifact", "featureset")},
1260
- ),
1261
- ]