The output formatting is inspired by pandas' DataFrame formatting for terminals. Similar to pandas' behavior, the above output could be extended to creating HTML formatted output when Jupyter is used.
On Jupyter,
```
f.to_array().to_pandas()
```
produces
grid
velocity
T
density
Y_H2
Y_H
Y_O
Y_O2
Y_OH
Y_H2O
Y_HO2
Y_H2O2
Y_AR
Y_N2
0
0.0000
0.727045
300.000000
1.338612
0.009478
1.001306e-17
-1.218188e-16
0.136764
-6.255833e-18
-4.651697e-19
2.807527e-18
-1.596152e-17
0.853758
-1.715061e-19
1
0.0060
0.727045
300.000000
1.338612
0.009478
4.160246e-22
-8.545371e-17
0.136764
-1.426867e-19
-4.616339e-17
1.839306e-16
-1.557736e-17
0.853758
1.511059e-19
2
0.0120
0.727045
300.000000
1.338612
0.009478
-1.111190e-22
-5.987089e-17
0.136764
-9.186857e-20
-7.358939e-17
6.687452e-17
-1.695206e-17
0.853758
-8.894063e-19
3
0.0150
0.727045
300.000000
1.338612
0.009478
8.584904e-23
-4.302447e-17
0.136764
-5.268582e-21
1.452886e-16
8.635578e-17
-9.436319e-18
0.853758
5.013727e-18
4
0.0165
0.727045
300.000000
1.338612
0.009478
-3.950800e-22
-1.537121e-17
0.136764
-1.554119e-19
7.344556e-15
5.245678e-17
1.905086e-18
0.853758
-2.035465e-18
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
135
0.0330
4.148673
1858.589950
0.234589
0.000004
1.761981e-07
3.176888e-05
0.063450
5.089945e-04
8.216367e-02
8.518582e-07
5.078716e-08
0.853841
-1.134663e-15
136
0.0360
4.149756
1859.118289
0.234527
0.000004
1.481708e-07
2.830112e-05
0.063462
4.808296e-04
8.218310e-02
8.283907e-07
4.877670e-08
0.853841
-1.149641e-15
137
0.0420
4.150466
1859.464840
0.234487
0.000003
1.312334e-07
2.609431e-05
0.063471
4.619602e-04
8.219592e-02
8.147194e-07
4.752173e-08
0.853841
-1.129344e-15
138
0.0480
4.150702
1859.579882
0.234474
0.000003
1.258723e-07
2.537544e-05
0.063474
4.556363e-04
8.220018e-02
8.105112e-07
4.711874e-08
0.853841
-1.133396e-15
139
0.0600
4.150702
1859.579882
0.234474
0.000003
1.258723e-07
2.537544e-05
0.063474
4.556363e-04
8.220018e-02
8.105112e-07
4.711874e-08
0.853841
-1.133396e-15
140 rows × 14 columns
where satisfactory output formatting for `SolutionArray` itself would require some tweaks.
Motivation
Describe the need for the proposed change:
What problem is it trying to solve? ... provide nicely formatted simulation output
Who is affected by the change? ... users of Jupyter
Why is this a good solution? ... HTML tables use available space efficiently
Possible Solutions
The basic infrastructure is already in place in C++; the only missing step is a conversion to a html formatted table used by a new SolutionArray._repr_html_() method.
Abstract
With Cantera/cantera#1462,
SolutionArray
gained a formatted summary/representation, for example aFreeFlame
object can be inspected as:The output formatting is inspired by pandas'
DataFrame
formatting for terminals. Similar to pandas' behavior, the above output could be extended to creating HTML formatted output when Jupyter is used.140 rows × 14 columns
Motivation
Describe the need for the proposed change:
Possible Solutions
The basic infrastructure is already in place in C++; the only missing step is a conversion to a html formatted table used by a new
SolutionArray._repr_html_()
method.References