Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions espei/error_functions/zpf_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def _extract_pot_conds(all_conditions: Dict[v.StateVariable, np.ndarray], idx: i
# Otherwise treat it as a scalar
if len(cond_val) > 1:
cond_val = cond_val[idx]
else:
cond_val = cond_val[0] # need to explictly extract scalar for NumPy type conversion
pot_conds[getattr(v, cond_key)] = float(cond_val)
return pot_conds

Expand Down
6 changes: 2 additions & 4 deletions espei/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,8 @@ def plot_interaction(dbf, comps, phase_name, configuration, output, datasets=Non
# TODO: Fix this to filter because we need to guarantee the plot points are disordered
occ = data['solver']['sublattice_occupancies']
subl_idx = np.nonzero([isinstance(c, (list, tuple)) for c in occ[0]])[0]
if len(subl_idx) > 1:
subl_idx = int(subl_idx[0])
else:
subl_idx = int(subl_idx)
# Always take the first matching sublattice index
subl_idx = int(subl_idx[0])
indep_var_data = [c[subl_idx][1] for c in occ]
else:
interactions = np.array([cond_dict[Symbol('YS')] for cond_dict in sample_condition_dicts])
Expand Down