Skip to content

Commit

Permalink
Omit phase pars in dict if no phase provided
Browse files Browse the repository at this point in the history
  • Loading branch information
jadball committed Jan 24, 2025
1 parent 8715bea commit 33fdc27
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ImageD11/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,13 @@ def get_xfab_pars_dict(self, phase_name=None):
if phase_name is not None:
# get parameters for a specific phase
phase_pars_dict = self.phase_pars_obj_dict[phase_name].get_parameters()
# copy the geometry dict to a new dict
pars_dict = geometry_pars_dict.copy()
# add in the phase pars
pars_dict.update(phase_pars_dict)
else:
# get any phase pars as a dict
phase_pars_dict = self.get_any_phase_pars_obj().get_parameters()
# combine dicts together
pars_dict = phase_pars_dict.copy()
pars_dict.update(geometry_pars_dict)
# just copy the geometry dict
pars_dict = geometry_pars_dict.copy()
return pars_dict

def load_json(self, filename):
Expand Down

0 comments on commit 33fdc27

Please sign in to comment.