MCPcopy Create free account
hub / github.com/Cantera/cantera / test_write_csv_fancy

Method test_write_csv_fancy

test/python/test_composite.py:589–605  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

587 arr.save(outfile)
588
589 def test_write_csv_fancy(self):
590 outfile = self.test_work_path / "solutionarray_fancy.csv"
591 outfile.unlink(missing_ok=True)
592
593 extra = {"foo": range(7), "bar": range(7), "spam": "eggs"}
594 arr = ct.SolutionArray(self.gas, 7, extra=extra)
595 arr.TPX = np.linspace(300, 1000, 7), 2e5, "H2:0.5, O2:0.4"
596 arr.equilibrate("HP")
597 arr.save(outfile)
598
599 with open(outfile, "r") as fid:
600 header = fid.readline()
601 assert "Y_H2" in header.split(",")
602
603 b = ct.SolutionArray(self.gas)
604 b.read_csv(outfile)
605 self.check_arrays(arr, b)
606
607 def test_write_csv_escaped(self):
608 outfile = self.test_work_path / "solutionarray_escaped.csv"

Callers

nothing calls this directly

Calls 6

equilibrateMethod · 0.95
saveMethod · 0.95
read_csvMethod · 0.95
check_arraysMethod · 0.95
SolutionArrayMethod · 0.80
splitMethod · 0.80

Tested by

no test coverage detected