Cantera / cantera

Chemical kinetics, thermodynamics, and transport tool suite
https://cantera.org
Other
582 stars 342 forks source link

Make SolutionArray formatting consistent for different {fmt} versions #1547

Closed speth closed 11 months ago

speth commented 11 months ago

Changes proposed in this pull request

With {fmt} 6.1.2, this changes the output of:

import cantera as ct
p = ct.Water()
arr = ct.SolutionArray(p, 12)
print(arr)

from

      T        D
0.0 300.0  996.633
1.0 300.0  996.633
2.0 300.0  996.633
3.0 300.0  996.633
4.0 300.0  996.633
..  ...      ...
7.0 300.0  996.633
8.0 300.0  996.633
9.0 300.0  996.633
10.0 300.0  996.633
11.0 300.0  996.633

[12 rows x 2 components; state='TD']

to

      T        D
0   300  996.633
1   300  996.633
2   300  996.633
3   300  996.633
4   300  996.633
..  ...      ...
7   300  996.633
8   300  996.633
9   300  996.633
10  300  996.633
11  300  996.633

[12 rows x 2 components; state='TD']

If applicable, fill in the issue number this pull request is fixing

Closes #1526

If applicable, provide an example illustrating new features this pull request is introducing

Checklist

codecov[bot] commented 11 months ago

Codecov Report

Merging #1547 (2782780) into main (a8a1c83) will decrease coverage by 0.03%. The diff coverage is 71.42%.

@@            Coverage Diff             @@
##             main    #1547      +/-   ##
==========================================
- Coverage   70.49%   70.46%   -0.03%     
==========================================
  Files         379      379              
  Lines       59091    59091              
  Branches    21228    21228              
==========================================
- Hits        41658    41641      -17     
- Misses      14353    14369      +16     
- Partials     3080     3081       +1     
Impacted Files Coverage Δ
src/base/SolutionArray.cpp 78.57% <71.42%> (ø)

... and 3 files with indirect coverage changes

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