(self)
| 567 | assert b.meta[key] == value |
| 568 | |
| 569 | def test_write_csv(self): |
| 570 | outfile = self.test_work_path / "solutionarray_new.csv" |
| 571 | outfile.unlink(missing_ok=True) |
| 572 | |
| 573 | arr = ct.SolutionArray(self.gas, 7) |
| 574 | arr.TPX = np.linspace(300, 1000, 7), 2e5, "H2:0.5, O2:0.4" |
| 575 | arr.equilibrate("HP") |
| 576 | arr.save(outfile, basis="mole") |
| 577 | |
| 578 | with open(outfile, "r") as fid: |
| 579 | header = fid.readline() |
| 580 | assert "X_H2" in header.split(",") |
| 581 | |
| 582 | b = ct.SolutionArray(self.gas) |
| 583 | b.read_csv(outfile) |
| 584 | self.check_arrays(arr, b) |
| 585 | |
| 586 | with pytest.raises(ct.CanteraError, match="already exists"): |
| 587 | arr.save(outfile) |
| 588 | |
| 589 | def test_write_csv_fancy(self): |
| 590 | outfile = self.test_work_path / "solutionarray_fancy.csv" |
nothing calls this directly
no test coverage detected