def test_iast_vle_checks(self, load_iast): """Checks for built-in safeguards.""" ch4, c2h6 = load_iast # Raises "not enough components error" with pytest.raises(pygaps.ParameterError): pygaps.iast_binary_vle([ch4], 1)
def test_iast_vle_model(self, load_iast_models): """Tests the vle-pressure graph""" result_dict = pygaps.iast_binary_vle(load_iast_models, 1) x_data = result_dict['x'] y_data = result_dict['y'] dev = sum(y_data - x_data) expected_dev = 8.8 assert numpy.isclose(dev, expected_dev, atol=0.1)
def test_iast_checks(self, load_iast): ch4, c2h6 = load_iast # IAST CHECKS # Raises error components with pytest.raises(ParameterError): pygaps.iast([ch4], [0.1]) # Raises error different dimensions with pytest.raises(ParameterError): pygaps.iast([ch4, c2h6], [0.1]) # REVERSE IAST CHECKS # Raises error components with pytest.raises(ParameterError): pygaps.reverse_iast([ch4], [0.1], 2) # Raises error different dimensions with pytest.raises(ParameterError): pygaps.reverse_iast([ch4, c2h6], [0.1], 2) # Raises error sum not adds to one with pytest.raises(ParameterError): pygaps.reverse_iast([ch4, c2h6], [0.1, 0.4], 2) # VLE CHECKS # Raises error components with pytest.raises(ParameterError): pygaps.iast_binary_vle([ch4], 1) # SVP CHECKS # Raises error components with pytest.raises(ParameterError): pygaps.iast_binary_svp([ch4], [0.1], [1, 2]) # Raises error not adds to one with pytest.raises(ParameterError): pygaps.iast_binary_svp([ch4, c2h6], [0.1, 0.4], [1, 2])
def test_iast_vle(self, load_iast): """Tests the vle-pressure graph""" ch4, c2h6 = load_iast result_dict = pygaps.iast_binary_vle([ch4, c2h6], 1) x_data = result_dict['x'] y_data = result_dict['y'] dev = sum(y_data - x_data) expected_dev = 6.7 assert numpy.isclose(dev, expected_dev, atol=0.1)
def test_iast_vle_verbose(self, load_iast): """Test verbosity.""" pygaps.iast_binary_vle(load_iast, 1, verbose=True)