Skip to content

Conversation

@mdw771
Copy link
Collaborator

@mdw771 mdw771 commented Jun 20, 2025

Features/fixes

Added routines to export Options objects' contents to dictionaries, and to import contents into Options objects from dictionaries

  • PtychographyTask has 2 new methods: get_options_as_dict returns a nested JSON-serializable dictionary of the master Options objects and its sub-options; load_options_from_dict populates values of self.options and its sub-options -- self.data_options, self.object_options, etc., with a dictionary.
  • Each Options class now has get_dict and load_from_dict that does the same.

The export methods only export non-data fields, i.e., fields that are not large NumPy arrays or PyTorch tensors. These include:

  • DataOptions.data
  • ObjectOptions.initial_guess
  • ObjectOptions.valid_pixel_mask
  • ProbeOptions.initial_guess
  • ProbePositionOptions.position_x/y_px
  • OPRModeWeightsOptions.initial_weights

Mentions

@stevehenke

Checklist

Have you...

  • Formatted your code properly adhering to PEP-8? Considering using RUFF to format your code automatically.
  • Resolved all merge conflicts with the main branch?
  • Checked the diffs between your branch and the main branch to ensure that your changes are not introducing any regressions or unnecessary/irrelevant changes?

@mdw771 mdw771 merged commit 71a9fc9 into main Jun 20, 2025
2 checks passed
@mdw771 mdw771 deleted the options_io branch July 25, 2025 18:34
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

Successfully merging this pull request may close these issues.

2 participants