From 1399ad3ba349d32a976d0bd8b32750e7105a3386 Mon Sep 17 00:00:00 2001 From: oltcs <162949+oltcs@users.noreply.github.com> Date: Sat, 20 Jul 2024 19:32:38 +0200 Subject: [PATCH 1/3] Upgrade to Pydantic V2 (2.8.2) --- pyproject.toml | 2 +- requirements.txt | 2 +- src/harmony/examples.py | 2 +- src/harmony/matching/matcher.py | 2 +- src/harmony/schemas/requests/text.py | 216 ++++++++++++------------- src/harmony/util/instrument_helper.py | 2 +- tests/test_convert_excel_openpyxl.py | 2 +- tests/test_convert_excel_xlsxwriter.py | 2 +- tests/test_convert_pdf.py | 2 +- tests/test_convert_text.py | 2 +- tests/test_match.py | 4 +- tests/test_pdf_tables.py | 4 +- 12 files changed, 116 insertions(+), 126 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6c19526..2dbbd20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ classifiers=[ # core dependencies of harmony # this set should be kept minimal! dependencies = [ - "pydantic==1.10.7; python_version <= '3.12'", + "pydantic==2.8.2; python_version <= '3.12'", "pandas==2.0.0; python_version <= '3.12'", "tika==2.6.0; python_version <= '3.12'", "lxml==4.9.2; python_version <= '3.12'", diff --git a/requirements.txt b/requirements.txt index c3efda9..c979453 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -pydantic==1.10.7 +pydantic==2.8.2 pandas==2.0.0 tika==2.6.0 lxml==4.9.2 diff --git a/src/harmony/examples.py b/src/harmony/examples.py index c455b9c..0cee7ae 100644 --- a/src/harmony/examples.py +++ b/src/harmony/examples.py @@ -33,7 +33,7 @@ sed "s/\bnull\b/None/g" example_questionnaires.json | sed '$!s/$/,/' >> ../harmony/src/harmony/examples.py ''' -example_instruments = dict([(i["instrument_name"], Instrument.parse_obj(i)) for i in [ +example_instruments = dict([(i["instrument_name"], Instrument.model_validate(i)) for i in [ {"file_id": "83a12170a5a74809885affc0c381dd41", "instrument_id": "b45b7169e711414582768b8c8431027c", "instrument_name": "CES_D English", "file_name": "CES_D English.pdf", "file_type": "pdf", "file_section": None, "study": None, "sweep": None, "metadata": None, "language": "en", "questions": [{"question_no": "1", "question_intro": None, "question_text": "I was bothered by things that usually don’t bother me.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "2", "question_intro": None, "question_text": "I did not feel like eating; my appetite was poor.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "3", "question_intro": None, "question_text": "I felt that I could not shake off the blues even with help from my family or friends.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "4", "question_intro": None, "question_text": "I felt I was just as good as other people.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "5", "question_intro": None, "question_text": "I had trouble keeping my mind on what I was doing.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "6", "question_intro": None, "question_text": "I felt depressed.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "7", "question_intro": None, "question_text": "I felt that everything I did was an effort.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "8", "question_intro": None, "question_text": "I felt hopeful about the future.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "9", "question_intro": None, "question_text": "I thought my life had been a failure.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "10", "question_intro": None, "question_text": "I felt fearful.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "11", "question_intro": None, "question_text": "My sleep was restless.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "12", "question_intro": None, "question_text": "I was happy.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "13", "question_intro": None, "question_text": "I talked less than usual.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "14", "question_intro": None, "question_text": "I felt lonely.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "15", "question_intro": None, "question_text": "People were unfriendly.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "16", "question_intro": None, "question_text": "I enjoyed life.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "17", "question_intro": None, "question_text": "I had crying spells.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "18", "question_intro": None, "question_text": "I felt sad.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "19", "question_intro": None, "question_text": "I felt that people dislike me.", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "20", "question_intro": None, "question_text": "I could not get “going.”", "options": ["Rarely or none of the time (less than 1 day)", "Some or a little of the time (1-2 days)", "Occasionally or a moderate amount of time (3-4 days)", "Most or all of the time (5-7 days)"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}]}, {"file_id": "614b672c9dfb41c386fbbd4e44ff38b4", "instrument_id": "65c0c54c3f2d4288b232f2df3c1db889", "instrument_name": "SCARED English (adult)", "file_name": "SCARED English (adult).pdf", "file_type": "pdf", "file_section": None, "study": None, "sweep": None, "metadata": None, "language": "en", "questions": [{"question_no": "1", "question_intro": None, "question_text": "When I feel frightened, it is hard for me to breathe", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "2", "question_intro": None, "question_text": "I get headaches when I am at school", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "3", "question_intro": None, "question_text": "I don’t like to be with people I don’t know well", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "4", "question_intro": None, "question_text": "I get scared if I sleep away from home", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "5", "question_intro": None, "question_text": "I worry about other people liking me", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "6", "question_intro": None, "question_text": "When I get frightened, I feel like passing out", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "7", "question_intro": None, "question_text": "I am nervous", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "8", "question_intro": None, "question_text": "I follow my mother or father wherever they go", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "9", "question_intro": None, "question_text": "People tell me that I look nervous", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "10", "question_intro": None, "question_text": "I feel nervous with people I don’t know well", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "11", "question_intro": None, "question_text": "My I get stomachaches at school", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "12", "question_intro": None, "question_text": "When I get frightened, I feel like I am going crazy", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "13", "question_intro": None, "question_text": "I worry about sleeping alone", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "14", "question_intro": None, "question_text": "I worry about being as good as other kids", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "15", "question_intro": None, "question_text": "When I get frightened, I feel like things are not real", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "16", "question_intro": None, "question_text": "I have nightmares about something bad happening to my parents", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "17", "question_intro": None, "question_text": "I worry about going to school", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "18", "question_intro": None, "question_text": "When I get frightened, my heart beats fast", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "19", "question_intro": None, "question_text": "I get shaky", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "20", "question_intro": None, "question_text": "I have nightmares about something bad happening to me", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "21", "question_intro": None, "question_text": "I worry about things working out for me", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "22", "question_intro": None, "question_text": "When I get frightened, I sweat a lot", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "23", "question_intro": None, "question_text": "I am a worrier", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "24", "question_intro": None, "question_text": "I get really frightened for no reason at all", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "25", "question_intro": None, "question_text": "I am afraid to be alone in the house", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "26", "question_intro": None, "question_text": "It is hard for me to talk with people I don’t know well", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "27", "question_intro": None, "question_text": "When I get frightened, I feel like I am choking", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "28", "question_intro": None, "question_text": "People tell me that I worry too much", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "29", "question_intro": None, "question_text": "I don’t like to be away from my family", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "30", "question_intro": None, "question_text": "I am afraid of having anxiety (or panic) attacks", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "31", "question_intro": None, "question_text": "I worry that something bad might happen to my parents", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "32", "question_intro": None, "question_text": "I feel shy with people I don’t know well", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "33", "question_intro": None, "question_text": "I worry about what is going to happen in the future", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "34", "question_intro": None, "question_text": "When I get frightened, I feel like throwing up", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "35", "question_intro": None, "question_text": "I worry about how well I do things", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "36", "question_intro": None, "question_text": "I am scared to go to school", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "37", "question_intro": None, "question_text": "I worry about things that have already happened", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "38", "question_intro": None, "question_text": "When I get frightened, I feel dizzy", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "39", "question_intro": None, "question_text": "I feel nervous when I am with other children or adults and I have to do something while they watch me (for example: read aloud, speak, play a game, play a sport)", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "40", "question_intro": None, "question_text": "I feel nervous when I am going to parties, dances, or any place where there will be people that I don’t know well", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "41", "question_intro": None, "question_text": "I am shy", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}]}, {"file_id": "2643b44e8bb94556b37cab134e5c0afe", "instrument_id": "a2ebc5ef638e46cd94ad1d99fbfdaeae", "instrument_name": "SCARED English (child)", "file_name": "SCARED English (child).pdf", "file_type": "pdf", "file_section": None, "study": None, "sweep": None, "metadata": None, "language": "en", "questions": [{"question_no": "1", "question_intro": None, "question_text": "When my child feels frightened, it is hard for him/her to breathe", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "2", "question_intro": None, "question_text": "My child gets headaches when he/she is at school", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "3", "question_intro": None, "question_text": "My child doesn’t like to be with people he/she doesn’t know well", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "4", "question_intro": None, "question_text": "My child gets scared if he/she sleeps away from home", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "5", "question_intro": None, "question_text": "My child worries about other people liking him/her", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "6", "question_intro": None, "question_text": "When my child gets frightened, he/she feels like passing out", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "7", "question_intro": None, "question_text": "My child is nervous", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "8", "question_intro": None, "question_text": "My child follows me wherever I go", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "9", "question_intro": None, "question_text": "People tell me that my child looks nervous", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "10", "question_intro": None, "question_text": "My child feels nervous with people he/she doesn’t know well", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "11", "question_intro": None, "question_text": "My child gets stomachaches at school", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "12", "question_intro": None, "question_text": "When my child gets frightened, he/she feels like he/she is going crazy", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "13", "question_intro": None, "question_text": "My child worries about sleeping alone", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "14", "question_intro": None, "question_text": "My child worries about being as good as other kids", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "15", "question_intro": None, "question_text": "When he/she gets frightened, he/she feels like things are not real", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "16", "question_intro": None, "question_text": "My child has nightmares about something bad happening to his/her parents", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "17", "question_intro": None, "question_text": "My child worries about going to school", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "18", "question_intro": None, "question_text": "When my child gets frightened, his/her heart beats fast", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "19", "question_intro": None, "question_text": "He/she gets shaky", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "20", "question_intro": None, "question_text": "My child has nightmares about something bad happening to him/her", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "21", "question_intro": None, "question_text": "My child worries about things working out for him/her", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "22", "question_intro": None, "question_text": "When my child gets frightened, he/she sweats a lot", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "23", "question_intro": None, "question_text": "My child is a worrier", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "24", "question_intro": None, "question_text": "My child gets really frightened for no reason at all", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "25", "question_intro": None, "question_text": "My child is afraid to be alone in the house", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "26", "question_intro": None, "question_text": "It is hard for my child to talk with people he/she doesn’t know well", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "27", "question_intro": None, "question_text": "When my child gets frightened, he/she feels like he/she is choking", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "28", "question_intro": None, "question_text": "People tell me that my child worries too much", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "29", "question_intro": None, "question_text": "My child doesn’t like to be away from his/her family", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "30", "question_intro": None, "question_text": "My child is afraid of having anxiety (or panic) attacks", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "31", "question_intro": None, "question_text": "My child worries that something bad might happen to his/her parents", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "32", "question_intro": None, "question_text": "My child feels shy with people he/she doesn’t know well", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "33", "question_intro": None, "question_text": "My child worries about what is going to happen in the future", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "34", "question_intro": None, "question_text": "When my child gets frightened, he/she feels like throwing up", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "35", "question_intro": None, "question_text": "My child worries about how well he/she does things", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "36", "question_intro": None, "question_text": "My child is scared to go to school", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "37", "question_intro": None, "question_text": "My child worries about things that have already happened", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "38", "question_intro": None, "question_text": "When my child gets frightened, he/she feels dizzy", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "39", "question_intro": None, "question_text": "My child feels nervous when he/she is with other children or adults and he/she has to do something while they watch him/her (for example: read aloud, speak, play a game, play a sport)", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "40", "question_intro": None, "question_text": "My child feels nervous when he/she is going to parties, dances, or any place where there will be people that he/she doesn’t know well", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}, {"question_no": "41", "question_intro": None, "question_text": "My child is shy", "options": ["Not True or Hardly Ever True", "Somewhat True or Sometimes True", "Very True or Often True"], "source_page": 0, "instrument_id": None, "instrument_name": None, "topics_auto": None, "nearest_match_from_mhc_auto": None}]}, diff --git a/src/harmony/matching/matcher.py b/src/harmony/matching/matcher.py index ebb9a3b..5b71413 100644 --- a/src/harmony/matching/matcher.py +++ b/src/harmony/matching/matcher.py @@ -208,7 +208,7 @@ def match_instruments_with_function( ctrs[all_questions[idx].instrument_id] = Counter() for topic in mhc_all_metadatas[mhc_item_idx]["topics"]: ctrs[all_questions[idx].instrument_id][topic] += 1 - all_questions[idx].nearest_match_from_mhc_auto = mhc_questions[mhc_item_idx].dict() + all_questions[idx].nearest_match_from_mhc_auto = mhc_questions[mhc_item_idx].model_dump() strength_of_match = similarities_mhc[idx, mhc_item_idx] all_questions[idx].topics_strengths = {topic: float(strength_of_match)} diff --git a/src/harmony/schemas/requests/text.py b/src/harmony/schemas/requests/text.py index 26b01eb..e3b6dd0 100644 --- a/src/harmony/schemas/requests/text.py +++ b/src/harmony/schemas/requests/text.py @@ -25,9 +25,9 @@ ''' -from typing import List +from typing import List, Optional -from pydantic import BaseModel, Field +from pydantic import ConfigDict, BaseModel, Field from harmony.schemas.enums.file_types import FileType from harmony.schemas.enums.languages import Language @@ -37,97 +37,89 @@ class RawFile(BaseModel): - file_id: str = Field(None, description="Unique identifier for the file (UUID-4)") + file_id: Optional[str] = Field(None, description="Unique identifier for the file (UUID-4)") file_name: str = Field("Untitled file", description="The name of the input file") file_type: FileType = Field(description="The file type (pdf, xlsx, txt)") content: str = Field(description="The raw file contents") - text_content: str = Field(None, description="The plain text content") + text_content: Optional[str] = Field(None, description="The plain text content") tables: list = Field([], description="The tables in the file") - - class Config: - schema_extra = { - "example": { - "file_id": "d39f31718513413fbfc620c6b6135d0c", - "file_name": "GAD-7.pdf", - "file_type": "pdf", - "content": "data:application/pdf;base64,JVBERi0xLjQKJcOiw6MKMSAwIG9iago8PAovVGl0bGUgKCkKL0NyZWF0b3IgKP7/AHcAawBoAHQAbQBsAHQAbwBwAGQAZgAgADAALgAxADIALgA1KQovUHJvZHVjZXIgKP7/AFEAdAAgADUALgAxADIALgA4KQovQ3JlYXRpb25EYXRlIChEOjIwMjMwNDA0MTkwNzE2KzAxJzAwJykKPj4KZW5kb2JqCjIgMCBvYmoKPDwKL1R5cGUgL0NhdGFsb2cKL1BhZ2VzIDMgMCBSCj4+CmVuZG9iago0IDAgb2JqCjw8Ci9UeXBlIC9FeHRHU3RhdGUKL1NBIHRydWUKL1NNIDAuMDIKL2NhIDEuMAovQ0EgMS4wCi9BSVMgZmFsc2UKL1NNYXNrIC9Ob25lPj4KZW5kb2JqCjUgMCBvYmoKWy9QYXR0ZXJuIC9EZXZpY2VSR0JdCmVuZG9iago2IDAgb2JqCjw8Ci9UeXBlIC9QYWdlCi9QYXJlbnQgMyAwIFIKL0NvbnRlbnRzIDggMCBSCi9SZXNvdXJjZXMgMTAgMCBSCi9Bbm5vdHMgMTEgMCBSCi9NZWRpYUJveCBbMCAwIDU5NS4wMDAwMDAgODQyLjAwMDAwMF0KPj4KZW5kb2JqCjEwIDAgb2JqCjw8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Q0IDAwMDAwIG4gCjAwMDAwMDA0ODQgMDAwMDAgbiAKMDAwMDAwMDY1MCAwMDAwMCBuIAowMDAwMDAxMjYzIDAwMDAwIG4gCjAwMDAwMDE1MzkgMDAwMDAgbiAKMDAwMDAwNzEzNSAwMDAwMCBuIAowMDAwMDA3NDU0IDAwMDAwIG4gCjAwMDAwMDgxODkgMDAwMDAgbiAKMDAwMDAwNzExNCAwMDAwMCBuIAp0cmFpbGVyCjw8Ci9TaXplIDE4IAovSW5mbyAxIDAgUgovUm9vdCAyIDAgUgo+PgpzdGFydHhyZWYKODM0MSAKJSVFT0YK" - } + model_config = ConfigDict(json_schema_extra={ + "example": { + "file_id": "d39f31718513413fbfc620c6b6135d0c", + "file_name": "GAD-7.pdf", + "file_type": "pdf", + "content": "data:application/pdf;base64,JVBERi0xLjQKJcOiw6MKMSAwIG9iago8PAovVGl0bGUgKCkKL0NyZWF0b3IgKP7/AHcAawBoAHQAbQBsAHQAbwBwAGQAZgAgADAALgAxADIALgA1KQovUHJvZHVjZXIgKP7/AFEAdAAgADUALgAxADIALgA4KQovQ3JlYXRpb25EYXRlIChEOjIwMjMwNDA0MTkwNzE2KzAxJzAwJykKPj4KZW5kb2JqCjIgMCBvYmoKPDwKL1R5cGUgL0NhdGFsb2cKL1BhZ2VzIDMgMCBSCj4+CmVuZG9iago0IDAgb2JqCjw8Ci9UeXBlIC9FeHRHU3RhdGUKL1NBIHRydWUKL1NNIDAuMDIKL2NhIDEuMAovQ0EgMS4wCi9BSVMgZmFsc2UKL1NNYXNrIC9Ob25lPj4KZW5kb2JqCjUgMCBvYmoKWy9QYXR0ZXJuIC9EZXZpY2VSR0JdCmVuZG9iago2IDAgb2JqCjw8Ci9UeXBlIC9QYWdlCi9QYXJlbnQgMyAwIFIKL0NvbnRlbnRzIDggMCBSCi9SZXNvdXJjZXMgMTAgMCBSCi9Bbm5vdHMgMTEgMCBSCi9NZWRpYUJveCBbMCAwIDU5NS4wMDAwMDAgODQyLjAwMDAw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DAwMDY3MCAwMDAwMCBuIAowMDAwMDAxMjQ0IDAwMDAwIG4gCjAwMDAwMDA0ODQgMDAwMDAgbiAKMDAwMDAwMDY1MCAwMDAwMCBuIAowMDAwMDAxMjYzIDAwMDAwIG4gCjAwMDAwMDE1MzkgMDAwMDAgbiAKMDAwMDAwNzEzNSAwMDAwMCBuIAowMDAwMDA3NDU0IDAwMDAwIG4gCjAwMDAwMDgxODkgMDAwMDAgbiAKMDAwMDAwNzExNCAwMDAwMCBuIAp0cmFpbGVyCjw8Ci9TaXplIDE4IAovSW5mbyAxIDAgUgovUm9vdCAyIDAgUgo+PgpzdGFydHhyZWYKODM0MSAKJSVFT0YK" } + }) class Question(BaseModel): - question_no: str = Field(None, description="Number of the question") - question_intro: str = Field(None, description="Introductory text applying to the question") + question_no: Optional[str] = Field(None, description="Number of the question") + question_intro: Optional[str] = Field(None, description="Introductory text applying to the question") question_text: str = Field(description="Text of the question") options: List[str] = Field([], description="The possible answer options") source_page: int = Field(0, description="The page of the PDF on which the question was located, zero-indexed") - instrument_id: str = Field(None, description="Unique identifier for the instrument (UUID-4)") - instrument_name: str = Field(None, description="Human readable name for the instrument") - topics_auto: list = Field(None, description="Automated list of topics identified by model") - topics_strengths: dict = Field(None, description="Automated list of topics identified by model with strength of topic") - nearest_match_from_mhc_auto: dict = Field(None, description="Automatically identified nearest MHC match") - - class Config: - schema_extra = { - "example": { - "question_no": "1", - "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", - "question_text": "Feeling nervous, anxious, or on edge", - "options": ["Not at all", "Several days", "More than half the days", "Nearly every day"], - "source_page": 0 - } + instrument_id: Optional[str] = Field(None, description="Unique identifier for the instrument (UUID-4)") + instrument_name: Optional[str] = Field(None, description="Human readable name for the instrument") + topics_auto: Optional[list] = Field(None, description="Automated list of topics identified by model") + topics_strengths: Optional[dict] = Field(None, description="Automated list of topics identified by model with strength of topic") + nearest_match_from_mhc_auto: Optional[dict] = Field(None, description="Automatically identified nearest MHC match") + model_config = ConfigDict(json_schema_extra={ + "example": { + "question_no": "1", + "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", + "question_text": "Feeling nervous, anxious, or on edge", + "options": ["Not at all", "Several days", "More than half the days", "Nearly every day"], + "source_page": 0 } + }) class Instrument(BaseModel): - file_id: str = Field(None, description="Unique identifier for the file (UUID-4)") - instrument_id: str = Field(None, description="Unique identifier for the instrument (UUID-4)") + file_id: Optional[str] = Field(None, description="Unique identifier for the file (UUID-4)") + instrument_id: Optional[str] = Field(None, description="Unique identifier for the instrument (UUID-4)") instrument_name: str = Field("Untitled instrument", description="Human-readable name of the instrument") file_name: str = Field("Untitled file", description="The name of the input file") - file_type: FileType = Field(None, description="The file type (pdf, xlsx, txt)") - file_section: str = Field(None, description="The sub-section of the file, e.g. Excel tab") - study: str = Field(None, description="The study") - sweep: str = Field(None, description="The sweep") - metadata: dict = Field(None, + file_type: Optional[FileType] = Field(None, description="The file type (pdf, xlsx, txt)") + file_section: Optional[str] = Field(None, description="The sub-section of the file, e.g. Excel tab") + study: Optional[str] = Field(None, description="The study") + sweep: Optional[str] = Field(None, description="The sweep") + metadata: Optional[dict] = Field(None, description="Optional metadata about the instrument (URL, citation, DOI, copyright holder)") language: Language = Field(Language.English, description="The ISO 639-2 (alpha-2) encoding of the instrument language") questions: List[Question] = Field(description="the items inside the instrument") - - class Config: - schema_extra = { - "example": { - "file_id": "fd60a9a64b1b4078a68f4bc06f20253c", - "instrument_id": "7829ba96f48e4848abd97884911b6795", - "instrument_name": "GAD-7 English", - "file_name": "GAD-7.pdf", - "file_type": "pdf", - "file_section": "GAD-7 English", - "language": "en", - "study": "MCS", - "sweep": "Sweep 1", - "questions": [{"question_no": "1", - "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", - "question_text": "Feeling nervous, anxious, or on edge", - "options": ["Not at all", "Several days", "More than half the days", - "Nearly every day"], - "source_page": 0 - }] - } + model_config = ConfigDict(json_schema_extra={ + "example": { + "file_id": "fd60a9a64b1b4078a68f4bc06f20253c", + "instrument_id": "7829ba96f48e4848abd97884911b6795", + "instrument_name": "GAD-7 English", + "file_name": "GAD-7.pdf", + "file_type": "pdf", + "file_section": "GAD-7 English", + "language": "en", + "study": "MCS", + "sweep": "Sweep 1", + "questions": [{"question_no": "1", + "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", + "question_text": "Feeling nervous, anxious, or on edge", + "options": ["Not at all", "Several days", "More than half the days", + "Nearly every day"], + "source_page": 0 + }] } + }) class MatchParameters(BaseModel): framework: str = Field(DEFAULT_FRAMEWORK, description="The framework to use for matching") model: str = Field(DEFAULT_MODEL, description="Model") - - class Config: - schema_extra = { - "example": { - "framework": DEFAULT_FRAMEWORK, - "model": DEFAULT_MODEL - } + model_config = ConfigDict(json_schema_extra={ + "example": { + "framework": DEFAULT_FRAMEWORK, + "model": DEFAULT_MODEL } + }) DEFAULT_MATCH_PARAMETERS = MatchParameters(framework=DEFAULT_FRAMEWORK, model=DEFAULT_MODEL) @@ -135,66 +127,64 @@ class Config: class MatchBody(BaseModel): instruments: List[Instrument] = Field(description="Instruments to harmonise") - query: str = Field(None, description="Search term") + query: Optional[str] = Field(None, description="Search term") parameters: MatchParameters = Field(DEFAULT_MATCH_PARAMETERS, description="Parameters on how to match") + model_config = ConfigDict(json_schema_extra={ + "example": { + "instruments": [{ + "file_id": "fd60a9a64b1b4078a68f4bc06f20253c", + "instrument_id": "7829ba96f48e4848abd97884911b6795", + "instrument_name": "GAD-7 English", + "file_name": "GAD-7 EN.pdf", + "file_type": "pdf", + "file_section": "GAD-7 English", + "language": "en", + "questions": [{"question_no": "1", + "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", + "question_text": "Feeling nervous, anxious, or on edge", + "options": ["Not at all", "Several days", "More than half the days", + "Nearly every day"], + "source_page": 0 + }, + {"question_no": "2", + "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", + "question_text": "Not being able to stop or control worrying", + "options": ["Not at all", "Several days", "More than half the days", + "Nearly every day"], + "source_page": 0 + } - class Config: - schema_extra = { - "example": { - "instruments": [{ + ] + }, + { "file_id": "fd60a9a64b1b4078a68f4bc06f20253c", "instrument_id": "7829ba96f48e4848abd97884911b6795", - "instrument_name": "GAD-7 English", - "file_name": "GAD-7 EN.pdf", + "instrument_name": "GAD-7 Portuguese", + "file_name": "GAD-7 PT.pdf", "file_type": "pdf", - "file_section": "GAD-7 English", + "file_section": "GAD-7 Portuguese", "language": "en", "questions": [{"question_no": "1", - "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", - "question_text": "Feeling nervous, anxious, or on edge", - "options": ["Not at all", "Several days", "More than half the days", - "Nearly every day"], + "question_intro": "Durante as últimas 2 semanas, com que freqüência você foi incomodado/a pelos problemas abaixo?", + "question_text": "Sentir-se nervoso/a, ansioso/a ou muito tenso/a", + "options": ["Nenhuma vez", "Vários dias", "Mais da metade dos dias", + "Quase todos os dias"], "source_page": 0 }, {"question_no": "2", - "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", - "question_text": "Not being able to stop or control worrying", - "options": ["Not at all", "Several days", "More than half the days", - "Nearly every day"], + "question_intro": "Durante as últimas 2 semanas, com que freqüência você foi incomodado/a pelos problemas abaixo?", + "question_text": " Não ser capaz de impedir ou de controlar as preocupações", + "options": ["Nenhuma vez", "Vários dias", "Mais da metade dos dias", + "Quase todos os dias"], "source_page": 0 } ] - }, - { - "file_id": "fd60a9a64b1b4078a68f4bc06f20253c", - "instrument_id": "7829ba96f48e4848abd97884911b6795", - "instrument_name": "GAD-7 Portuguese", - "file_name": "GAD-7 PT.pdf", - "file_type": "pdf", - "file_section": "GAD-7 Portuguese", - "language": "en", - "questions": [{"question_no": "1", - "question_intro": "Durante as últimas 2 semanas, com que freqüência você foi incomodado/a pelos problemas abaixo?", - "question_text": "Sentir-se nervoso/a, ansioso/a ou muito tenso/a", - "options": ["Nenhuma vez", "Vários dias", "Mais da metade dos dias", - "Quase todos os dias"], - "source_page": 0 - }, - {"question_no": "2", - "question_intro": "Durante as últimas 2 semanas, com que freqüência você foi incomodado/a pelos problemas abaixo?", - "question_text": " Não ser capaz de impedir ou de controlar as preocupações", - "options": ["Nenhuma vez", "Vários dias", "Mais da metade dos dias", - "Quase todos os dias"], - "source_page": 0 - } - - ] - } - - ], - "query": "anxiety", - "parameters": {"framework": DEFAULT_FRAMEWORK, - "model": DEFAULT_MODEL} - } + } + + ], + "query": "anxiety", + "parameters": {"framework": DEFAULT_FRAMEWORK, + "model": DEFAULT_MODEL} } + }) diff --git a/src/harmony/util/instrument_helper.py b/src/harmony/util/instrument_helper.py index 6d57d89..46a1c9f 100644 --- a/src/harmony/util/instrument_helper.py +++ b/src/harmony/util/instrument_helper.py @@ -52,7 +52,7 @@ def import_instrument_into_harmony_web(instrument: Instrument, harmony_fe_base_u @param harmony_fe_base_url: The base URL of the React app front end, defaulting to the web Harmony front end at harmonydata.ac.uk @return: a URL which you can click which will take you to the browser. """ - instrument_serialised_as_json = json.dumps(instrument.dict()) + instrument_serialised_as_json = json.dumps(instrument.model_dump()) instrument_json_b64_encoded_bytes = base64.urlsafe_b64encode(instrument_serialised_as_json.encode('utf-8')) instrument_json_b64_encoded_str = instrument_json_b64_encoded_bytes.decode("utf-8") diff --git a/tests/test_convert_excel_openpyxl.py b/tests/test_convert_excel_openpyxl.py index 9dc5d45..dc5b928 100644 --- a/tests/test_convert_excel_openpyxl.py +++ b/tests/test_convert_excel_openpyxl.py @@ -33,7 +33,7 @@ from harmony import convert_excel_to_instruments from harmony.schemas.requests.text import RawFile -xlsx_gad_7_2_questions = RawFile.parse_obj({ +xlsx_gad_7_2_questions = RawFile.model_validate({ "file_id": "1d66bce4b80c4b0eaefe33f00cddedef", "file_name": "GAD-7.xlsx", "file_type": "xlsx", diff --git a/tests/test_convert_excel_xlsxwriter.py b/tests/test_convert_excel_xlsxwriter.py index b7c018f..f819693 100644 --- a/tests/test_convert_excel_xlsxwriter.py +++ b/tests/test_convert_excel_xlsxwriter.py @@ -33,7 +33,7 @@ sys.path.append("../src") -xlsx_gad_7_2_questions = RawFile.parse_obj({ +xlsx_gad_7_2_questions = RawFile.model_validate({ "file_id": "1d66bce4b80c4b0eaefe33f00cddedef", "file_name": "GAD-7.xlsx", "file_type": "xlsx", diff --git a/tests/test_convert_pdf.py b/tests/test_convert_pdf.py index fb33ea1..b1ede9e 100644 --- a/tests/test_convert_pdf.py +++ b/tests/test_convert_pdf.py @@ -34,7 +34,7 @@ from harmony.schemas.requests.text import RawFile from harmony import download_models -pdf_gad_7_2_questions = RawFile.parse_obj({ +pdf_gad_7_2_questions = RawFile.model_validate({ "file_id": "d39f31718513413fbfc620c6b6135d0c", "file_name": "GAD-7.pdf", "file_type": "pdf", diff --git a/tests/test_convert_text.py b/tests/test_convert_text.py index 1dd9069..e2d59b8 100644 --- a/tests/test_convert_text.py +++ b/tests/test_convert_text.py @@ -33,7 +33,7 @@ from harmony import convert_text_to_instruments from harmony.schemas.requests.text import RawFile -txt_gad_7_2_questions = RawFile.parse_obj({ +txt_gad_7_2_questions = RawFile.model_validate({ "file_id": "d39f31718513413fbfc620c6b6135d0c", "file_name": "GAD-7.txt", "file_type": "txt", diff --git a/tests/test_match.py b/tests/test_match.py index b276df2..fe845ce 100644 --- a/tests/test_match.py +++ b/tests/test_match.py @@ -43,7 +43,7 @@ question_text="Durante as últimas 2 semanas, com que freqüência você foi incomodado/a pelos problemas abaixo?")] instrument_pt = Instrument(questions=questions_pt, language="pt") -instrument_1 = Instrument.parse_obj({ +instrument_1 = Instrument.model_validate({ "file_id": "fd60a9a64b1b4078a68f4bc06f20253c", "instrument_id": "7829ba96f48e4848abd97884911b6795", "instrument_name": "GAD-7 English", @@ -80,7 +80,7 @@ } ) -instrument_2 = Instrument.parse_obj({ +instrument_2 = Instrument.model_validate({ "file_id": "fd60a9a64b1b4078a68f4bc06f20253c", "instrument_id": "7829ba96f48e4848abd97884911b6795", "instrument_name": "GAD-7 Portuguese", diff --git a/tests/test_pdf_tables.py b/tests/test_pdf_tables.py index a4854cd..a2ad2fd 100644 --- a/tests/test_pdf_tables.py +++ b/tests/test_pdf_tables.py @@ -35,7 +35,7 @@ from harmony import download_models -pdf_empty_table = RawFile.parse_obj({ +pdf_empty_table = RawFile.model_validate({ "file_id": "d39f31718513413fbfc620c6b6135d0c", "file_name": "GAD-7.pdf", "file_type": "pdf", @@ -44,7 +44,7 @@ "content":"" }) -pdf_non_empty_table = RawFile.parse_obj({ +pdf_non_empty_table = RawFile.model_validate({ "file_id": "d39f31718513413fbfc620c6b6135d0c", "file_name": "GAD-7.pdf", "file_type": "pdf", From 330afd1babc53d33c89fb1bb3251a65718a2d84e Mon Sep 17 00:00:00 2001 From: oltcs <162949+oltcs@users.noreply.github.com> Date: Sat, 20 Jul 2024 20:09:52 +0200 Subject: [PATCH 2/3] Reformat to avoid multi-line diffs --- src/harmony/schemas/requests/text.py | 183 ++++++++++++++------------- 1 file changed, 94 insertions(+), 89 deletions(-) diff --git a/src/harmony/schemas/requests/text.py b/src/harmony/schemas/requests/text.py index e3b6dd0..51dae49 100644 --- a/src/harmony/schemas/requests/text.py +++ b/src/harmony/schemas/requests/text.py @@ -43,14 +43,15 @@ class RawFile(BaseModel): content: str = Field(description="The raw file contents") text_content: Optional[str] = Field(None, description="The plain text content") tables: list = Field([], description="The tables in the file") - model_config = ConfigDict(json_schema_extra={ - "example": { - "file_id": "d39f31718513413fbfc620c6b6135d0c", - "file_name": "GAD-7.pdf", - "file_type": "pdf", - "content": "data:application/pdf;base64,JVBERi0xLjQKJcOiw6MKMSAwIG9iago8PAovVGl0bGUgKCkKL0NyZWF0b3IgKP7/AHcAawBoAHQAbQBsAHQAbwBwAGQAZgAgADAALgAxADIALgA1KQovUHJvZHVjZXIgKP7/AFEAdAAgADUALgAxADIALgA4KQovQ3JlYXRpb25EYXRlIChEOjIwMjMwNDA0MTkwNzE2KzAxJzAwJykKPj4KZW5kb2JqCjIgMCBvYmoKPDwKL1R5cGUgL0NhdGFsb2cKL1BhZ2VzIDMgMCBSCj4+CmVuZG9iago0I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9QYWdlcwovS2lkcyAKWwo2IDAgUgpdCi9Db3VudCAxCi9Qcm9jU2V0IFsvUERGIC9UZXh0IC9JbWFnZUIgL0ltYWdlQ10KPj4KZW5kb2JqCnhyZWYKMCAxOAowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMTUgMDAwMDAgbiAKMDAwMDAwMDE2OSAwMDAwMCBuIAowMDAwMDA4MjQzIDAwMDAwIG4gCjAwMDAwMDAyMTggMDAwMDAgbiAKMDAwMDAwMDMxMyAwMDAwMCBuIAowMDAwMDAwMzUwIDAwMDAwIG4gCjAwMDAwMDgwNTIgMDAwMDAgbiAKMDAwMDAwMDY3MCAwMDAwMCBuIAowMDAwMDAxMjQ0IDAwMDAwIG4gCjAwMDAwMDA0ODQgMDAwMDAgbiAKMDAwMDAwMDY1MCAwMDAwMCBuIAowMDAwMDAxMjYzIDAwMDAwIG4gCjAwMDAwMDE1MzkgMDAwMDAgbiAKMDAwMDAwNzEzNSAwMDAwMCBuIAowMDAwMDA3NDU0IDAwMDAwIG4gCjAwMDAwMDgxODkgMDAwMDAgbiAKMDAwMDAwNzExNCAwMDAwMCBuIAp0cmFpbGVyCjw8Ci9TaXplIDE4IAovSW5mbyAxIDAgUgovUm9vdCAyIDAgUgo+PgpzdGFydHhyZWYKODM0MSAKJSVFT0YK" - } - }) + model_config = ConfigDict( + json_schema_extra={ + "example": { + "file_id": "d39f31718513413fbfc620c6b6135d0c", + "file_name": "GAD-7.pdf", + "file_type": "pdf", + "content": "data:application/pdf;base64,JVBERi0xLjQKJcOiw6MKMSAwIG9iago8PAovVGl0bGUgKCkKL0NyZWF0b3IgKP7/AHcAawBoAHQAbQBsAHQAbwBwAGQAZgAgADAALgAxADIALgA1KQovUHJvZHVjZXIgKP7/AFEAdAAgADUALgAxADIALgA4KQovQ3JlYXRpb25EYXRlIChEOjIwMjMwNDA0MTkwNzE2KzAxJzAwJykKPj4KZW5kb2JqCjIgMCBvYmoKPDwKL1R5cGUgL0NhdGFs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WFtCmVuZG9iagozIDAgb2JqCjw8Ci9UeXBlIC9QYWdlcwovS2lkcyAKWwo2IDAgUgpdCi9Db3VudCAxCi9Qcm9jU2V0IFsvUERGIC9UZXh0IC9JbWFnZUIgL0ltYWdlQ10KPj4KZW5kb2JqCnhyZWYKMCAxOAowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMTUgMDAwMDAgbiAKMDAwMDAwMDE2OSAwMDAwMCBuIAowMDAwMDA4MjQzIDAwMDAwIG4gCjAwMDAwMDAyMTggMDAwMDAgbiAKMDAwMDAwMDMxMyAwMDAwMCBuIAowMDAwMDAwMzUwIDAwMDAwIG4gCjAwMDAwMDgwNTIgMDAwMDAgbiAKMDAwMDAwMDY3MCAwMDAwMCBuIAowMDAwMDAxMjQ0IDAwMDAwIG4gCjAwMDAwMDA0ODQgMDAwMDAgbiAKMDAwMDAwMDY1MCAwMDAwMCBuIAowMDAwMDAxMjYzIDAwMDAwIG4gCjAwMDAwMDE1MzkgMDAwMDAgbiAKMDAwMDAwNzEzNSAwMDAwMCBuIAowMDAwMDA3NDU0IDAwMDAwIG4gCjAwMDAwMDgxODkgMDAwMDAgbiAKMDAwMDAwNzExNCAwMDAwMCBuIAp0cmFpbGVyCjw8Ci9TaXplIDE4IAovSW5mbyAxIDAgUgovUm9vdCAyIDAgUgo+PgpzdGFydHhyZWYKODM0MSAKJSVFT0YK" + } + }) class Question(BaseModel): @@ -64,15 +65,16 @@ class Question(BaseModel): topics_auto: Optional[list] = Field(None, description="Automated list of topics identified by model") topics_strengths: Optional[dict] = Field(None, description="Automated list of topics identified by model with strength of topic") nearest_match_from_mhc_auto: Optional[dict] = Field(None, description="Automatically identified nearest MHC match") - model_config = ConfigDict(json_schema_extra={ - "example": { - "question_no": "1", - "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", - "question_text": "Feeling nervous, anxious, or on edge", - "options": ["Not at all", "Several days", "More than half the days", "Nearly every day"], - "source_page": 0 - } - }) + model_config = ConfigDict( + json_schema_extra={ + "example": { + "question_no": "1", + "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", + "question_text": "Feeling nervous, anxious, or on edge", + "options": ["Not at all", "Several days", "More than half the days", "Nearly every day"], + "source_page": 0 + } + }) class Instrument(BaseModel): @@ -89,37 +91,39 @@ class Instrument(BaseModel): language: Language = Field(Language.English, description="The ISO 639-2 (alpha-2) encoding of the instrument language") questions: List[Question] = Field(description="the items inside the instrument") - model_config = ConfigDict(json_schema_extra={ - "example": { - "file_id": "fd60a9a64b1b4078a68f4bc06f20253c", - "instrument_id": "7829ba96f48e4848abd97884911b6795", - "instrument_name": "GAD-7 English", - "file_name": "GAD-7.pdf", - "file_type": "pdf", - "file_section": "GAD-7 English", - "language": "en", - "study": "MCS", - "sweep": "Sweep 1", - "questions": [{"question_no": "1", - "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", - "question_text": "Feeling nervous, anxious, or on edge", - "options": ["Not at all", "Several days", "More than half the days", - "Nearly every day"], - "source_page": 0 - }] - } + model_config = ConfigDict( + json_schema_extra={ + "example": { + "file_id": "fd60a9a64b1b4078a68f4bc06f20253c", + "instrument_id": "7829ba96f48e4848abd97884911b6795", + "instrument_name": "GAD-7 English", + "file_name": "GAD-7.pdf", + "file_type": "pdf", + "file_section": "GAD-7 English", + "language": "en", + "study": "MCS", + "sweep": "Sweep 1", + "questions": [{"question_no": "1", + "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", + "question_text": "Feeling nervous, anxious, or on edge", + "options": ["Not at all", "Several days", "More than half the days", + "Nearly every day"], + "source_page": 0 + }] + } }) class MatchParameters(BaseModel): framework: str = Field(DEFAULT_FRAMEWORK, description="The framework to use for matching") model: str = Field(DEFAULT_MODEL, description="Model") - model_config = ConfigDict(json_schema_extra={ - "example": { - "framework": DEFAULT_FRAMEWORK, - "model": DEFAULT_MODEL - } - }) + model_config = ConfigDict( + json_schema_extra={ + "example": { + "framework": DEFAULT_FRAMEWORK, + "model": DEFAULT_MODEL + } + }) DEFAULT_MATCH_PARAMETERS = MatchParameters(framework=DEFAULT_FRAMEWORK, model=DEFAULT_MODEL) @@ -129,62 +133,63 @@ class MatchBody(BaseModel): instruments: List[Instrument] = Field(description="Instruments to harmonise") query: Optional[str] = Field(None, description="Search term") parameters: MatchParameters = Field(DEFAULT_MATCH_PARAMETERS, description="Parameters on how to match") - model_config = ConfigDict(json_schema_extra={ - "example": { - "instruments": [{ - "file_id": "fd60a9a64b1b4078a68f4bc06f20253c", - "instrument_id": "7829ba96f48e4848abd97884911b6795", - "instrument_name": "GAD-7 English", - "file_name": "GAD-7 EN.pdf", - "file_type": "pdf", - "file_section": "GAD-7 English", - "language": "en", - "questions": [{"question_no": "1", - "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", - "question_text": "Feeling nervous, anxious, or on edge", - "options": ["Not at all", "Several days", "More than half the days", - "Nearly every day"], - "source_page": 0 - }, - {"question_no": "2", - "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", - "question_text": "Not being able to stop or control worrying", - "options": ["Not at all", "Several days", "More than half the days", - "Nearly every day"], - "source_page": 0 - } - - ] - }, - { + model_config = ConfigDict( + json_schema_extra={ + "example": { + "instruments": [{ "file_id": "fd60a9a64b1b4078a68f4bc06f20253c", "instrument_id": "7829ba96f48e4848abd97884911b6795", - "instrument_name": "GAD-7 Portuguese", - "file_name": "GAD-7 PT.pdf", + "instrument_name": "GAD-7 English", + "file_name": "GAD-7 EN.pdf", "file_type": "pdf", - "file_section": "GAD-7 Portuguese", + "file_section": "GAD-7 English", "language": "en", "questions": [{"question_no": "1", - "question_intro": "Durante as últimas 2 semanas, com que freqüência você foi incomodado/a pelos problemas abaixo?", - "question_text": "Sentir-se nervoso/a, ansioso/a ou muito tenso/a", - "options": ["Nenhuma vez", "Vários dias", "Mais da metade dos dias", - "Quase todos os dias"], + "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", + "question_text": "Feeling nervous, anxious, or on edge", + "options": ["Not at all", "Several days", "More than half the days", + "Nearly every day"], "source_page": 0 }, {"question_no": "2", - "question_intro": "Durante as últimas 2 semanas, com que freqüência você foi incomodado/a pelos problemas abaixo?", - "question_text": " Não ser capaz de impedir ou de controlar as preocupações", - "options": ["Nenhuma vez", "Vários dias", "Mais da metade dos dias", - "Quase todos os dias"], + "question_intro": "Over the last two weeks, how often have you been bothered by the following problems?", + "question_text": "Not being able to stop or control worrying", + "options": ["Not at all", "Several days", "More than half the days", + "Nearly every day"], "source_page": 0 } ] - } - - ], - "query": "anxiety", - "parameters": {"framework": DEFAULT_FRAMEWORK, - "model": DEFAULT_MODEL} - } - }) + }, + { + "file_id": "fd60a9a64b1b4078a68f4bc06f20253c", + "instrument_id": "7829ba96f48e4848abd97884911b6795", + "instrument_name": "GAD-7 Portuguese", + "file_name": "GAD-7 PT.pdf", + "file_type": "pdf", + "file_section": "GAD-7 Portuguese", + "language": "en", + "questions": [{"question_no": "1", + "question_intro": "Durante as últimas 2 semanas, com que freqüência você foi incomodado/a pelos problemas abaixo?", + "question_text": "Sentir-se nervoso/a, ansioso/a ou muito tenso/a", + "options": ["Nenhuma vez", "Vários dias", "Mais da metade dos dias", + "Quase todos os dias"], + "source_page": 0 + }, + {"question_no": "2", + "question_intro": "Durante as últimas 2 semanas, com que freqüência você foi incomodado/a pelos problemas abaixo?", + "question_text": " Não ser capaz de impedir ou de controlar as preocupações", + "options": ["Nenhuma vez", "Vários dias", "Mais da metade dos dias", + "Quase todos os dias"], + "source_page": 0 + } + + ] + } + + ], + "query": "anxiety", + "parameters": {"framework": DEFAULT_FRAMEWORK, + "model": DEFAULT_MODEL} + } + }) From 43043d29eb601c218ad250141f48c9a0e839d068 Mon Sep 17 00:00:00 2001 From: olp-cs <162949+olp-cs@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:00:20 +0300 Subject: [PATCH 3/3] Upgrade: __root__ -> RootModel --- src/harmony/schemas/responses/text.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/harmony/schemas/responses/text.py b/src/harmony/schemas/responses/text.py index 802e8f5..114c28d 100644 --- a/src/harmony/schemas/responses/text.py +++ b/src/harmony/schemas/responses/text.py @@ -29,7 +29,7 @@ from harmony.schemas.requests.text import Instrument from harmony.schemas.requests.text import Question -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, RootModel class MatchResponse(BaseModel): @@ -42,8 +42,8 @@ class MatchResponse(BaseModel): ) -class InstrumentList(BaseModel): - __root__: List[Instrument] +class InstrumentList(RootModel): + root: List[Instrument] class CacheResponse(BaseModel):