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

Serialization and representation (e.g. __str__) methods for various objects #16

Closed
stevetorr opened this issue Sep 5, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@stevetorr
Copy link
Contributor

stevetorr commented Sep 5, 2019

Methods for serializing certain objects which are passed between models (i.e. atomic environments, structures, etc), or even models themselves, would be useful. The advantage of this over pickled objects is that they can be more human-readable (and I understand that pickled objects have some security risks associated with them).

One example application is that JSON objects are easily storable in certain database architectures. This might be relevant for e.g. FOOGA in the near future if we want to automate the process of training GP models for different datasets, as this would let us store them more easily.

In my development branch I've done this for the AtomicEnvironment object. There are ways we could standardize this or easily implement it across our codebase (e.g. by using Monty, which has an object type which allows for effortless JSON serialization of different Python objects).

@jonpvandermause
Copy link
Collaborator

Good idea to serialize, would be nice to be able to print out attributes of the env/struc/gp objects. As for saving and storing entire gp models, pickle.dump(gp_model, gp_file) works well in practice.

@stevetorr stevetorr changed the title Serialization methods for various objects Serialization and reprentation (__str__) methods for various objects Sep 9, 2019
@stevetorr stevetorr changed the title Serialization and reprentation (__str__) methods for various objects Serialization and reprentation ( e.g. __str__) methods for various objects Sep 9, 2019
@stevetorr stevetorr changed the title Serialization and reprentation ( e.g. __str__) methods for various objects Serialization and reprentation (e.g. __str__) methods for various objects Sep 9, 2019
@stevetorr stevetorr changed the title Serialization and reprentation (e.g. __str__) methods for various objects Serialization and representation (e.g. __str__) methods for various objects Sep 9, 2019
@jonpvandermause jonpvandermause added the enhancement New feature or request label Sep 9, 2019
@stevetorr stevetorr self-assigned this Sep 19, 2019
@stevetorr
Copy link
Contributor Author

Todo: Look through classes in env, struc, gp, and add representations

@stevetorr
Copy link
Contributor Author

We have solved serialization.

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

No branches or pull requests

2 participants