Pope Paul VI
Sacerdotalis Caelibatus §63
Sacerdotalis Caelibatus: On the Celibacy of the Priest
63 It is likewise necessary that exact account be taken of the physical and psychological state of the candidate in order to guide and orient him toward the priestly ideal; so a truly adequate formation should harmoniously coordinate grace and nature in the man in whom one clearly sees the proper conditions and qualifications. These conditions should be ascertained as soon as signs of his holy vocation are first indicated—not hastily or superficially, but carefully, with the assistance and aid of a doctor or a competent psychologist. A serious investigation of hereditary factors should not be omitted.
Source: Sacerdotalis Caelibatus (Vatican.va)