Closed bocklund closed 8 months ago
@nury12n if you could review :)
Added some comments regarding the fitting steps, mainly thoughts I had when working with the FittingStep and AbstractLinearFittingStep classes, but I think it'd probably be better to leave as is.
I gave some thought about the diffusing species and I think it'll make more sense to consider them after there's some support in kawin for mobility fitting.
Thanks for reviewing! Since PyCalphad supports diffusion species, it's something that could be in scope for ESPEI, but my guess is that there are assumptions elsewhere in the parameter generation code that would need to be broken to be able to handle that extra dimension that parameters can also be a function of diffusing species. At least, I think having these FittingStep
and FittingDescription
abstractions are compatible with what would be needed to fit parameters with diffusion species and it's mostly a book-keeping and dataset selection operations in espei.paramselect.phase_fit
and espei.paramselect.fit_parameters
Tests are passing on pycalphad development versions and not release versions (as expected from https://github.com/pycalphad/pycalphad/pull/501). Merging
This is a significant feature improvement that introduces the concept of a
ModelFittingDescription
made up ofFittingStep
objects to tell ESPEI how to generate model parameters (with a capability to support generating parameters for custom models). In addition, these changes include:espei.paramselect
, the main module for parameter selection:fit_ternary_interactions
function was completely removed and binary and ternary interactions now run the exact same code path.fit_parameters
, which now relies on dependency injection of a fitting description to know what fitting steps to take (we try to not make any assumptions about what parameters or data types are being fit) and this function is more streamlined to 1) select relevant data from datasets, 2) get the RHS (b
inAx=b
) of the linear problem from the fitting step, 3) build candidate models (build a collection feature matrices,A
), 4) select the best model from the candidates, and 5) insert the parameter and coefficients for the best model into the databaseespei.parameter_selection.utils
. Some of the functionality got moved to be in fitting steps, andget_sample_condition_dicts
was moved toespei.error_functions.non_equilibrium_thermochemical_error
, withget_prop_samples
that it is used in conjunction with. Trying to have fewer "utils" modules.This PR relies on https://github.com/pycalphad/pycalphad/pull/501 that includes fixes for molar volume models. Tests will probably fail until that gets into the development branch.
Closes #5