Z.py: included error handling in set_res_phase()

Signed-off-by: LK <LK@uni>
PT.py: made everything attribute

Signed-off-by: LK <LK@uni>