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: Fix TDB line length bugs #392

Merged
merged 8 commits into from
Jan 29, 2022

Conversation

bocklund
Copy link
Collaborator

This fixes two bugs related to writing TDB files and reflowing lines:

  1. Fixes a bug in reflow_text where lines that are too long and contain no valid linebreak characters would result in an infinite loop of finding the same linebreak_idx and emitting the same line until running out of memory. Now lines that cannot be reflowed to under the linewidth raises an error.
  2. Adds a whitespace to the delimiter between species in the CONSTITUENTS line (it's now , instead of ,) so reflow_text can reflow the line at any element. This fixes a bug where phases with many constituents would trigger the infinite loop (and now error) from (1).

A test is added for each case.

@codecov
Copy link

codecov bot commented Jan 29, 2022

Codecov Report

Merging #392 (35acada) into develop (631c41c) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #392      +/-   ##
===========================================
+ Coverage    89.95%   89.98%   +0.03%     
===========================================
  Files           44       44              
  Lines         4369     4383      +14     
===========================================
+ Hits          3930     3944      +14     
  Misses         439      439              
Impacted Files Coverage Δ
pycalphad/io/tdb.py 87.66% <100.00%> (+0.02%) ⬆️
pycalphad/tests/test_database.py 100.00% <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 631c41c...35acada. Read the comment docs.

@bocklund bocklund merged commit 58fec40 into pycalphad:develop Jan 29, 2022
@bocklund bocklund deleted the FIX-database-line-length branch January 29, 2022 23:17
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.

2 participants