diff --git a/lnschema_core/migrations/0065_remove_collection_feature_sets_and_more.py b/lnschema_core/migrations/0065_remove_collection_feature_sets_and_more.py new file mode 100644 index 00000000..30a4dbba --- /dev/null +++ b/lnschema_core/migrations/0065_remove_collection_feature_sets_and_more.py @@ -0,0 +1,22 @@ +# Generated by Django 5.2 on 2024-09-08 11:37 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ( + "lnschema_core", + "0064_alter_artifact_version_alter_collection_version_and_more", + ), + ] + + operations = [ + migrations.RemoveField( + model_name="collection", + name="feature_sets", + ), + migrations.DeleteModel( + name="CollectionFeatureSet", + ), + ] diff --git a/lnschema_core/models.py b/lnschema_core/models.py index bb26d8bb..0b3f7244 100644 --- a/lnschema_core/models.py +++ b/lnschema_core/models.py @@ -772,18 +772,6 @@ class ParamManager: pass -class FeatureManagerArtifact(FeatureManager): - """Feature manager.""" - - pass - - -class FeatureManagerCollection(FeatureManager): - """Feature manager.""" - - pass - - class ParamManagerArtifact(ParamManager): """Param manager.""" @@ -1848,7 +1836,7 @@ class Meta(Record.Meta, IsVersioned.Meta, TracksRun.Meta, TracksUpdates.Meta): }) """ - features: FeatureManager = FeatureManagerArtifact # type: ignore + features: FeatureManager = FeatureManager # type: ignore """Feature manager. Features denote dataset dimensions, i.e., the variables that measure labels & numbers. @@ -2402,7 +2390,6 @@ class Meta(Record.Meta, IsVersioned.Meta, TracksRun.Meta, TracksUpdates.Meta): _len_full_uid: int = 20 _len_stem_uid: int = 16 - features = FeatureManagerCollection # type: ignore _name_field: str = "name" id: int = models.AutoField(primary_key=True) @@ -2426,10 +2413,6 @@ class Meta(Record.Meta, IsVersioned.Meta, TracksRun.Meta, TracksUpdates.Meta): max_length=25, db_index=True, null=True, default=None ) """Type of reference, e.g., cellxgene Census collection_id.""" - feature_sets: FeatureSet = models.ManyToManyField( - "FeatureSet", related_name="collections", through="CollectionFeatureSet" - ) - """The feature sets measured in this collection (see :class:`~lamindb.FeatureSet`).""" ulabels: ULabel = models.ManyToManyField( "ULabel", through="CollectionULabel", related_name="collections" ) @@ -2687,24 +2670,6 @@ class Meta: unique_together = ("artifact", "featureset") -class CollectionFeatureSet(Record, LinkORM, TracksRun): - id: int = models.BigAutoField(primary_key=True) - collection = models.ForeignKey( - Collection, CASCADE, related_name="links_feature_set" - ) - # we follow the lower() case convention rather than snake case for link models - featureset: FeatureSet = models.ForeignKey( - FeatureSet, PROTECT, related_name="links_collection" - ) - slot: str = CharField(max_length=50, null=True, default=None) - feature_ref_is_semantic: bool = models.BooleanField( - null=True, default=None - ) # like Feature name or Gene symbol or CellMarker name - - class Meta: - unique_together = ("collection", "featureset") - - class CollectionArtifact(Record, LinkORM, TracksRun): id: int = models.BigAutoField(primary_key=True) collection: Collection = models.ForeignKey(