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
8 changes: 4 additions & 4 deletions espei/parameter_selection/fitting_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ def shift_reference_state(cls, desired_data: [Dataset], fixed_model: Model, mole
if occupancy is None:
raise ValueError('Cannot have a _MIX property without sublattice occupancies.')
else:
values[..., config_idx] += cls.transform_feature(fixed_model.models['ref'])*mole_atoms_per_mole_formula_unit
values[..., config_idx] += cls.transform_feature(fixed_model.models['ref'])
else:
raise ValueError(f'Unknown property to shift: {dataset["output"]}')
for excluded_contrib in unique_excluded_contributions:
values[..., config_idx] += cls.transform_feature(fixed_model.models[excluded_contrib])*mole_atoms_per_mole_formula_unit
values[..., config_idx] += cls.transform_feature(fixed_model.models[excluded_contrib])
total_response.append(values.flatten())
return total_response

Expand All @@ -253,8 +253,8 @@ def get_response_vector(cls, fixed_model: Model, fixed_portions: [symengine.Basi
site_fractions = list(itertools.chain(*site_fractions))

data_qtys = np.concatenate(cls.shift_reference_state(data, fixed_model, mole_atoms_per_mole_formula_unit), axis=-1)
# Remove existing partial model contributions from the data, convert to per mole-formula units
data_qtys = data_qtys - cls.transform_feature(fixed_model.ast)*mole_atoms_per_mole_formula_unit
# Remove existing partial model contributions from the data
data_qtys = data_qtys - cls.transform_feature(fixed_model.ast)
# Subtract out high-order (in T) parameters we've already fit, already in per mole-formula units
data_qtys = data_qtys - cls.transform_feature(sum(fixed_portions))
# If any site fractions show up in our rhs that aren't in these
Expand Down
2 changes: 1 addition & 1 deletion tests/test_parameter_generation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_get_response_vector_AL_NI_VA_interaction():
""")
mod = Model(dbf, ['AL', 'NI', 'VA'], 'BCC_B2')
dd = {ky: 0.0 for ky in mod.models.keys()}
dd['GM'] = NEW_GM
dd['G'] = NEW_GM * mod._site_ratio_normalization
mod.models = dd
print(mod.HM)
config_tup = (('AL',), ('NI', 'VA'), ('VA',))
Expand Down
Loading