def test_point_water_08():
    assert not point_in_function(
        (Q_('270 K'), Q_('44150144.529 Pa')), water._clapeyron_sl)
    def physical_state(self, point):
        """
        Returns the physical state for a given point(temperature, pressure)
        Parameters
        ----------
        point
            tuple with temperature and pressure

        Returns
        -------
        string
            physical state
        """
        state = ''
        clapeyron_sv = partial(self._clapeyron_sv_lv, curve='sv')

        # triple point temperature

        if point[0] == self.triple_point[0]:
            if point[1] < self.triple_point[1]:
                state = 'vapour'
            else:
                if self.volume_change_fusion < 0:
                    state = 'liquid'
                else:
                    state = 'solid'

        # critical point temperature

        elif point[0] == self.critical_point[0]:
            if point[1] < self.critical_point[1]:
                state = 'vapour'
            else:
                state = 'liquid'

        # point on curve

        elif point_in_function(point, self._antoine_lv):
            state = 'liquid-vapour curve'
        elif point_in_function(point, self._clapeyron_sl):
            state = 'solid-liquid curve'
        elif point_in_function(point, clapeyron_sv):
            state = 'solid-vapour curve'

        # regions

        elif point[0] > self.critical_point.temperature:
            if point[1] > self.critical_point.pressure:
                state = 'supercritical fluid'
            else:
                state = 'gas'
        elif (point[0] > self.triple_point.temperature) and (
                point[1] < self._antoine_lv(point[0])):
            state = 'vapour'
        elif (point[0] < self.triple_point.temperature) and (
                point[1] < self._clapeyron_sv_lv(point[0], curve='sv')):
            state = 'vapour'
        elif self.volume_change_fusion > 0:
            if (point[0] < self.triple_point.temperature) and (
                    point[1] > self._clapeyron_sv_lv(point[0], curve='sv')):
                state = 'solid'
            else:
                state = 'liquid'
        elif self.volume_change_fusion < 0:
            if (point[0] < self.triple_point.temperature) and (
                    point[1] > self._clapeyron_sv_lv(point[0], curve='sv')):
                state = 'solid'
            else:
                state = 'liquid'

        return state
def test_point_water_06():
    assert not point_in_function(
        (Q_('200 K'), Q_('0.877 Pa')), water_clapeyron_lv)
def test_point_water_04():
    assert not point_in_function(
        (Q_('100 K'), Q_('1.64e-3 Pa')), water_clapeyron_sv)
def test_point_water_02():
    assert not point_in_function(
        (Q_('400 K'), Q_('246493.813 Pa')), water._antoine_lv)
def test_point_not_in_straight_line_function_tolerance():
    assert not point_in_function((Q_('3 m'), Q_('3.002 m')), straight_line_y)
def test_point_not_in_straight_line_function():
    assert not point_in_function((Q_('3 m'), Q_('4 m')), straight_line_y)