composeui.core.study

A study: the views’ state and the model’s data, started, saved and opened together.

Without data of its own in the model (Model.data_name is None), a study is the views’ state as JSON (MainView.save_state). With it, a study is a zip archive of the views’ state (views.json) and the model’s file, so the two are never saved or opened apart.

composeui.core.study.open_study(main_view, model, path, *, max_size=None)[source]

Open the study saved in the file path, into the views and the model.

Everything is checked before anything changes: raises InvalidStateError, leaving the views and the model unchanged, for a file that doesn’t fit them. max_size caps the archive’s unpacked size, in bytes, against a small file unpacking into a huge one.

Parameters:
Return type:

None

composeui.core.study.save_study(main_view, model, path)[source]

Save the views’ state and the model’s data into the file path.

Parameters:
Return type:

None