[1]:
from desdeo_tools.interaction.request import ReferencePointPreference as rpp
import pandas as pd
import numpy as np
[2]:
ddata = pd.DataFrame(columns=['x','y'], index=['nadir','ideal', 'minimize'])
[3]:
ddata.loc['nadir'] = [1,6]
ddata.loc['ideal'] = [0,0]
ddata.loc['minimize'] = [1,1]
[4]:
a = rpp(ddata)
[5]:
a.response = pd.DataFrame([[0,1.8]], columns=['x','y'])
[6]:
a.response = pd.DataFrame([[5,1.8]], columns=['x','y'])
---------------------------------------------------------------------------
ValidationError                           Traceback (most recent call last)
<ipython-input-6-d5f229b47471> in <module>
----> 1 a.response = pd.DataFrame([[5,1.8]], columns=['x','y'])

e:\projects\desdeo-tools\desdeo_tools\utilities\frozen.py in __setattr__(self, key, value)
     12         if self.__isfrozen and not hasattr(self, key):
     13             raise TypeError("%r is a frozen class" % self)
---> 14         object.__setattr__(self, key, value)
     15
     16     def _freeze(self):

e:\projects\desdeo-tools\desdeo_tools\interaction\request.py in response(self, value)
    380             raise RequestError(msg)
    381         self.content["validator"](
--> 382             reference_point=value, dimensions_data=self.content["dimensions_data"]
    383         )
    384         self._response = value

e:\projects\desdeo-tools\desdeo_tools\interaction\validators.py in validate_ref_point_with_ideal_and_nadir(dimensions_data, reference_point)
     14     validate_ref_point_data_type(reference_point)
     15     validate_ref_point_with_ideal(dimensions_data, reference_point)
---> 16     validate_with_ref_point_nadir(dimensions_data, reference_point)
     17
     18

e:\projects\desdeo-tools\desdeo_tools\interaction\validators.py in validate_with_ref_point_nadir(dimensions_data, reference_point)
     48             f"The following columns have problematic values: {problematic_columns}"
     49         )
---> 50         raise ValidationError(msg)
     51
     52

ValidationError: Reference point should be better than or equal to the nadir point
The following columns have problematic values: ['x']
[ ]:
help(a)