Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a model gets initiated, it would be good if the dataset information is saved with it in an easily accessible way, so that the model can be shared between different people, using, for example, a pickled model file.
Then, the user who receives the pickle file, can reconstitute the original model object easily and with minimal risk of error.
In current practice, to share a model, the user who initiates the model passes the code used to generate the model (or assumes that the receiver already has a copy of the same code). This can lead to subtle errors. For example, if the order of the phenotypes (a list of strings) is different between the code use by the initiator and the receiver, the phenotype information will get scrambled, and the receiver may end up inadvertently/unknowingly comparing predictions for one phenotype with experimental values for a different phenotype.
So, the easiest way I could find to do this is to save the dataset object as an attribute of the surface attributer of the model. And, since the surface attribute is typically an object of type lantern.model.surface.Phenotype, the only place I could find to easily make this change was in the Phenotype class constructor methods.