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

FIX: ignoring IF/THEN statements in TYPE_DEFINITION keywords #476

Merged
merged 1 commit into from Jul 4, 2023

Conversation

nury12n
Copy link
Contributor

@nury12n nury12n commented Jun 25, 2023

In ThermoCalc, the IF/THEN keywords in the TYPE_DEFINITION provides a way to run commands during database loading based off the elements selected. This typically is used for adding a composition set to help with miscibility gap detection or rejecting/restoring phases (though adding composition sets seems more common). Pycalphad detects miscibility gaps based off the sampling strategy and the rejecting/restoring phases may reduce transparency of the database to the users.

In pycalphad, the tdb parser assumes that the TYPE_DEFINITION command is used for disordered or magnetic contributions, in which the parser can fail if the command is not one of those two. This pull request will ignore any TYPE_DEFINITION that has an IF/THEN keyword and give a warning that parsing these keywords is currently not supported. This will allow for users to load tdb files that may contain the IF/THEN keywords without having to worry about fixing the tdb file and will also allow for the same tdb file to be used between pycalphad and ThermoCalc if a user(s) decides to do so.

@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Merging #476 (0df6707) into develop (846d2bc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop     #476   +/-   ##
========================================
  Coverage    90.29%   90.30%           
========================================
  Files           50       50           
  Lines         7768     7774    +6     
========================================
+ Hits          7014     7020    +6     
  Misses         754      754           
Impacted Files Coverage Δ
pycalphad/io/tdb.py 89.76% <100.00%> (+0.06%) ⬆️
pycalphad/tests/test_database.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bocklund bocklund self-requested a review June 28, 2023 15:24
@richardotis richardotis merged commit 9c52a2c into pycalphad:develop Jul 4, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants