Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Refactor _sample_phase_constitution #335



Copy link

@bocklund bocklund commented May 22, 2021

The rationale for this change is to remove Phase objects (and Database objects) from the core. Generally, the constituents of a Phase object may not be the same as the constituents of a Model object (they almost always are practically), so the core should use Model constituents so it can be decoupled from the database representation.

This is a potentially breaking change for anyone depending on this internal API.

This PR:

  • Changes the API of _sample_phase_constitution:
    • from _sample_phase_constitution(phase_name, phase_constituents, sublattice_dof, comps, variables, sampler, fixed_grid, pdens)
    • to _sample_phase_constitution(model, sampler, fixed_grid, pdens)
  • Documents Model.constituents as a step towards making the public API of Model objects better defined.
  • Deprecates generate_dof because it is no longer necessary and any "degree of freedom" counting can (and should) be done using a concrete Model

Copy link

codecov bot commented May 22, 2021

Codecov Report

Merging #335 (85bed10) into develop (29fa9b8) will decrease coverage by 0.29%.
The diff coverage is 78.94%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #335      +/-   ##
- Coverage    84.55%   84.25%   -0.30%     
  Files           45       45              
  Lines         4526     4529       +3     
- Hits          3827     3816      -11     
- Misses         699      713      +14     
Impacted Files Coverage Δ
pycalphad/ 91.82% <ø> (ø)
pycalphad/core/ 82.22% <20.00%> (-7.50%) ⬇️
pycalphad/core/ 93.06% <100.00%> (-0.08%) ⬇️
pycalphad/core/ 94.32% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29fa9b8...85bed10. Read the comment docs.

@bocklund bocklund requested a review from richardotis May 23, 2021 17:11
@bocklund bocklund merged commit 4e399bb into pycalphad:develop May 24, 2021
@bocklund bocklund deleted the MAINT-refactor-sample_phase_constitution branch May 24, 2021 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants