Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce raw/derived restrictions in Dataset #147

Open
jl-wynen opened this issue Sep 29, 2023 · 1 comment
Open

Enforce raw/derived restrictions in Dataset #147

jl-wynen opened this issue Sep 29, 2023 · 1 comment

Comments

@jl-wynen
Copy link
Collaborator

Currently, Dataset holds the union of fields of RawDataset and DerivedDataset and allows users to set all, regardless of the selected type. Should we instead allow setting only the fields of the selected type? (Note that type is mandatory in __init__, so it is always know. In particular if #146 gets implemented.)

This would help avoid the confusion between investigator and principalInvestigator.

This would have to be enforced in:

  • setters
  • __init__
  • derive
  • replace

Problem: it is possible to have invalid datasets in SciCat. We should still be able to represent those in Scitacean (#134). This would require a backdoor in the validation in order to create such a Dataset instance. And there already are backdoors. I don't want to add more.

@YooSunYoung
Copy link
Collaborator

Will it be too complicated to have type and flexibility...?
For example, we may have two types: raw and derived and two flexibility strict and flexible...?

Another thing I thought was to have read-only-Dataset, which can be used loading/downloading dataset and it should be flexible since they may read invalid datasets.
And writable-Dataset can strictly forbid invalid fields.
Because invalid Dataset will be forbidden to upload anyways right...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants