dandi / dandi/dandi-schema

Harmonize (strip away Type) *Type models

Open
#15 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7
Forks
15
PR merge metrics
No merged PRs in 30d

Description

ref: https://github.com/dandi/dandischema/pull/6/files#r639128369 saying

I am somewhat at loss of when `Type` suffix is used or not

Here are the ones without `Type` suffix

```shell
$> git grep 'class .*(' dandischema/models.py | grep -v 'Type('
dandischema/models.py:class HandleKeyEnumEncoder(json.JSONEncoder):
dandischema/models.py:class DandiBaseModelMeta(ModelMetaclass):
dandischema/models.py:class DandiBaseModel(BaseModel, metaclass=DandiBaseModelMeta):
dandischema/models.py:class PropertyValue(DandiBaseModel):
dandischema/models.py:class Anatomy(BaseType):
dandischema/models.py:class Disorder(BaseType):
dandischema/models.py:class ContactPoint(DandiBaseModel):
dandischema/models.py:class Contributor(DandiBaseModel):
dandischema/models.py:class Organization(Contributor):
dandischema/models.py:class Person(Contributor):
dandischema/models.py:class Software(DandiBaseModel):
dandischema/models.py:class Agent(DandiBaseModel):
dandischema/models.py:class EthicsApproval(DandiBaseModel):
dandischema/models.py:class Resource(DandiBaseModel):
dandischema/models.py:class AccessRequirements(DandiBaseModel):
dandischema/models.py:class AssetsSummary(DandiBaseModel):
dandischema/models.py:class Equipment(DandiBaseModel):
dandischema/models.py:class Activity(DandiBaseModel):
dandischema/models.py:class Project(Activity):
dandischema/models.py:class Session(Activity):
dandischema/models.py:class PublishActivity(Activity):
dandischema/models.py:class Locus(DandiBaseModel):
dandischema/models.py:class Allele(DandiBaseModel):
dandischema/models.py:class GenotypeInfo(DandiBaseModel):
dandischema/models.py:class RelatedParticipant(DandiBaseModel):
dandischema/models.py:class Participant(DandiBaseModel):
dandischema/models.py:class BioSample(DandiBaseModel):
dandischema/models.py:class CommonModel(DandiBaseModel):
dandischema/models.py:class Dandiset(CommonModel):
dandischema/models.py:class BareAsset(CommonModel):
dandischema/models.py:class Asset(BareAsset):
dandischema/models.py:class Publishable(DandiBaseModel):
dandischema/models.py:class PublishedDandiset(Dandiset, Publishable):
dandischema/models.py:class PublishedAsset(Asset, Publishable):
```

so from looks of it, if `Type` is desired for subclasses of `BaseType` then it is only
```
dandischema/models.py:class Anatomy(BaseType):
dandischema/models.py:class Disorder(BaseType):
```
which should be tuned up. But what is the rationale/benefit from keeping `Type` suffix altogether? It seems that `BaseType` is just an Enum-based `DandiBaseModel`. So they all could just be as happy without `Type` suffix and thus become consistent (I do not see a value from somehow annotating with Type that it is Enum based... what if some would be relaxed and no longer Enum based?)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.