예제 #1
0
    def test_tplot_choice(self):
        """Test choice of points."""

        sample = DATA['MCM-41']
        filepath = DATA_N77_PATH / sample['file']
        isotherm = pygaps.isotherm_from_json(filepath)

        res = pygaps.t_plot(isotherm, limits=[0.7, 1.0])
        results = res.get('results')

        err_relative = 0.1  # 10 percent
        err_absolute_area = 0.1  # units
        err_absolute_volume = 0.01  # units

        assert isclose(results[-1].get('adsorbed_volume'),
                       sample['t_pore_volume'], err_relative,
                       err_absolute_area)
        assert isclose(results[-1].get('area'), sample['s_t_area'],
                       err_relative, err_absolute_volume)
예제 #2
0
    def test_tplot(self, sample):
        """Test calculation with several model isotherms."""
        sample = DATA[sample]
        # exclude datasets where it is not applicable
        if sample.get('t_area', None):

            filepath = DATA_N77_PATH / sample['file']
            isotherm = pygaps.isotherm_from_json(filepath)

            res = pygaps.t_plot(isotherm)
            results = res.get('results')

            err_relative = 0.1  # 10 percent
            err_absolute_area = 0.1  # units
            err_absolute_volume = 0.01  # units

            assert isclose(results[-1].get('adsorbed_volume'),
                           sample['t_pore_volume'], err_relative,
                           err_absolute_area)
            assert isclose(results[0].get('area'), sample['t_area'],
                           err_relative, err_absolute_volume)
예제 #3
0
 def test_tplot_output(self):
     """Test verbosity."""
     sample = DATA['MCM-41']
     filepath = DATA_N77_PATH / sample['file']
     isotherm = pygaps.isotherm_from_json(filepath)
     pygaps.t_plot(isotherm, 'Halsey', verbose=True)
예제 #4
0
    def test_alphas_checks(self, basic_pointisotherm):
        """Checks for built-in safeguards."""

        # Will raise a "no suitable model exception"
        with pytest.raises(pgEx.ParameterError):
            pygaps.t_plot(basic_pointisotherm, thickness_model='random')