(self)
| 2457 | ct.PureFluid(yaml=yaml.format(T=370, Q=1.0)) |
| 2458 | |
| 2459 | def test_sort(self): |
| 2460 | np.random.seed(0) |
| 2461 | t = np.random.random(101) |
| 2462 | T = np.linspace(300., 1000., 101) |
| 2463 | P = ct.one_atm * (1. + 10.*np.random.random(101)) |
| 2464 | |
| 2465 | states = ct.SolutionArray(self.gas, 101, extra={'t': t}) |
| 2466 | states.TP = T, P |
| 2467 | |
| 2468 | states.sort('t') |
| 2469 | assert (states.t[1:] - states.t[:-1] > 0).all() |
| 2470 | assert not (states.T[1:] - states.T[:-1] > 0).all() |
| 2471 | assert not np.allclose(states.P, P) |
| 2472 | |
| 2473 | states.sort('T') |
| 2474 | assert not (states.t[1:] - states.t[:-1] > 0).all() |
| 2475 | assert (states.T[1:] - states.T[:-1] > 0).all() |
| 2476 | assert states.P == approx(P) |
| 2477 | |
| 2478 | states.sort('T', reverse=True) |
| 2479 | assert (states.T[1:] - states.T[:-1] < 0).all() |
| 2480 | |
| 2481 | def test_set_equivalence_ratio(self): |
| 2482 | states = ct.SolutionArray(self.gas, 8) |
nothing calls this directly
no test coverage detected