-
Notifications
You must be signed in to change notification settings - Fork 123
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
Analysis fails to run after serializing data retrieved from database #714
Comments
The bug is triggered by copying the data, i.e. |
It's triggered because |
After checking it I think we need to implement If we remove the |
I want to understand the use case for dumping the experiment data to a The json_value = {}
for att in [
"_metadata",
"_source",
"_service",
"_backend",
"_id",
"_parent_id",
"_type",
"_tags",
"_share_level",
"_notes",
"_data",
"_analysis_results",
"_analysis_callbacks",
"_deleted_figures",
"_deleted_analysis_results",
"_created_in_db",
"_extra_data",
]:
# the attribute self._service in charge of the connection and communication with the
# experiment db. It doesn't have meaning in the json format so there is no need to serialize
# it.
if att == "_service":
warnings.warn("'service' attribute isn't serializable.)
continue
value = getattr(self, att)
if value:
json_value[att] = value @chriseclectic, I would like to hear your opinion. |
@ItamarGoldman My use case for dumping the experiment data to JSON is data archival. For example, suppose the data is used to support results published in a research paper. Then the data should be made publicly available so the results of the paper can be verified and reproduced. |
I think the main issue here is that Service, Providers, and Backends are not properly JSON serializable, and can't easily be made JSON serializable because of the token authentication required for loading them. What happens now is these thing get serialized as an object, but deserialization fails and the partially deserialized dict gets set as the value in the objects containing them, which then leads to errors when other parts of code that interacts with them. In the BaseExperiment class if it gets a partially deserialized backend it just ignores it, but I don't think ExperimentData does the same sort of handling. One possible work around when deserializing these objects directly would be to display a warning message showing the saved metadata (backend / service name etc) and asking user to re-set these values, but then set the value to None so that the loaded object should still work (assuming it can work without a backend/service). Eg something like "Experiment was saved using (name) service which cannot be automatically loaded. Please reset service attribute if required" |
@kevinsung The
Because it is not experiment-related, experiment results can be restored without the need for |
Can this be closed? |
Yes. Closing the issue. |
Informations
What is the current behavior?
The following steps result in an error:
Steps to reproduce the problem
What is the expected behavior?
It should work.
Suggested solutions
The text was updated successfully, but these errors were encountered: