ENH: Add Component implementation in variables#546
ENH: Add Component implementation in variables#546bocklund merged 18 commits intopycalphad:developfrom
Conversation
|
I think there's value to trying to get something merged that has
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #546 +/- ##
===========================================
+ Coverage 91.83% 91.97% +0.13%
===========================================
Files 77 77
Lines 12121 12270 +149
===========================================
+ Hits 11131 11285 +154
+ Misses 990 985 -5 ☔ View full report in Codecov by Sentry. |
|
Given the context of just getting something in, I'm ready for some feedback @richardotis I'm not entirely happy with how things are done. Maybe we need a There's probably further distinction to make in |
|
If we're in the breaking spirit, I am also open to feedback on the renaming the current class Species(object):
...
class Component(Species):
...
class PhaseConstituent(Species):
...
# or
class Constituent(Species):
... |
b044399 to
c00632a
Compare

This PR sets the groundwork for more formally distinguishing a
Componentfrom aSpecies. It is breaking for the public API of Workspace, and consumers of the private API forpycalphad.core.utils.unpack_components. We are making these breaking changes now, so future changes that implement generalized (non-pure-element) component support can be non-breaking or minimally breaking in public APIs.The following changes are made:
v.Componentclass. This is similar toSpecies, but distinct because 1)Speciesare reserved to refer to phase constituents, and 2)Speciesare allowed to have chargespycalphad.core.utils.unpack_componentstounpack_speciesto be more accuratev.unpack_componentsfunction to process components following documented rules comparable to those in commercial software packagesWorkspaceAPI:4.1. Rename
Workspace.components, which is a container ofSpecies, objects toWorkspace.constituents.Workspace.constituentsautomatically update whenWorkspace.componentschange. Currently the constituents are not used in theWorkspaceimplementation and changes from users don't affect any calculations, but it might be possible to use this to suspend certain species.4.2. Add
ComponentsListandComponentsFieldimplementationsWorkspace, as a container ofComponentobjects inWorkspace.componentswith the ability to auto-populate fromDatabasepure elements and update when the database changes.What is not in this PR is explicit support for non-pure element components as a basis for use in conditions, properties, etc. Non-pure element components is a driver for the
Componentobject to exist, but support is not added here.