Пример #1
0
    def test_ienthalpy_point(self, sample):
        """The point method."""
        sample = DATA_CALO[sample]
        filepath = DATA_CALO_PATH / sample['file']
        isotherm = pygaps.isotherm_from_json(filepath)

        ienth_poly = pygaps.initial_enthalpy_point(isotherm, 'enthalpy'
                                                   ).get('initial_enthalpy')

        err_relative = 0.1  # 10 percent
        err_absolute = 1  #

        assert isclose(ienth_poly, sample['ienth'], err_relative, err_absolute)
Пример #2
0
    def test_ienthalpy_point(self, file, expected):
        """The point method."""

        filepath = os.path.join(DATA_CALO_PATH, file)

        with open(filepath, 'r') as text_file:
            isotherm = pygaps.isotherm_from_json(text_file.read())

        ienth_poly = pygaps.initial_enthalpy_point(
            isotherm, 'enthalpy', verbose=True).get('initial_enthalpy')

        err_relative = 0.1  # 10 percent
        err_absolute = 1  #

        assert isclose(ienth_poly, expected, err_relative, err_absolute)
Пример #3
0
 def test_ienthalpy_point_output(self):
     """Test verbosity."""
     sample = DATA_CALO['Takeda 5A']
     filepath = DATA_CALO_PATH / sample['file']
     isotherm = pygaps.isotherm_from_json(filepath)
     pygaps.initial_enthalpy_point(isotherm, 'enthalpy', verbose=True)
Пример #4
0
    def test_ienthalpy_point_checks(self, basic_pointisotherm):
        """Checks for built-in safeguards."""

        # Will raise a "can't find enthalpy column error"
        with pytest.raises(pgEx.ParameterError):
            pygaps.initial_enthalpy_point(basic_pointisotherm, 'wrong')