Closed missyschoenbaum closed 9 years ago
It took a while for state names to settle down in really early versions. We weren't picky about capitalization or spaces ("infectiousclinical" considered the same as "Infectious Clinical"). We also allowed "Incubating" instead of "Latent" and "Inapparent Shedding" instead of "Infectious Subclinical".
Actually, I am not sure where the option of Infectious clinical came from. It is not in the source database lookup, and the status in the population (dynherd) only show the codes, C,L and S. I had to export the population from this database as I didn't have it in XML already.
\ Magic happens here **
It will be a quick fix to make the xml-to-sqlite routine "normalize" some of those cases to the now-accepted names.
@ndh2 - OK, but I still think @josiahseaman needs to make the app behave nice when someone does something stupid that is beyond our speculation. I don't think we implemented constraints at the database level, which is how my brain manages these problems.
@josiahseaman there are still constraints at the database level where you cannot import the csv population file with the initial states already assigned; they all become "Susceptible" inside ADSM and you have to change them manually
Hi Sarah, the fix for this issue 5e8800c was just now pushed to production. Please try it again after updating. Thanks!
This is from an old xml file that appears to pass a status that is no longer valid. Infectious clinical Can the app manage an unknown status better?
@ndh2 - how many times in the past have we changed our status options?
This came from one of Barbara's examples.
Exception at /app/ImportScenario/ Infectious clinical is not a valid state Request Method: POST Request URL: http://127.0.0.1:8000/app/ImportScenario/ Django Version: 1.7.1 Exception Type: Exception Exception Value:
Infectious clinical is not a valid state Exception Location: C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\src\ADSMSettings\xml2sqlite.py in readPopulation, line 318 Python Executable: C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\ADSM.exe Python Version: 3.4.2 Python Path:
['C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\ADSM.exe', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\ADSM.zip', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\library.zip', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\src', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\DLLs', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\Lib', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\Lib\plat-win', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\Lib\lib-tk', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\Lib\site-packages', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\bin', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\Scripts', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\Lib\site-packages\cx_Freeze-4.3.4-py3.4-win-amd64.egg', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\Lib\site-packages\numpy-1.9.1-py3.4-win-amd64.egg', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\Lib\site-packages\pip-1.5.6-py3.4.egg', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\Lib\site-packages\pywin32-219-py3.4-win-amd64.egg', 'C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\src'] Server time: Mon, 16 Mar 2015 14:13:05 +0000 Traceback Switch to copy-and-paste view
C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\Lib\site-packages\django\core\handlers\base.py in get_response response = wrapped_callback(request, _callback_args, *_callback_kwargs) ... ▶ Local vars C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\src\ADSMSettings\views.py in import_naadsm_scenario return run_importer(request) ... ▶ Local vars C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\src\ADSMSettings\views.py in run_importer import_naadsm_xml(popul_path, param_path) # puts all the data in activeSession ... ▶ Local vars C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\src\ADSMSettings\xml2sqlite.py in import_naadsm_xml readPopulation(populationFileName) ... ▶ Local vars C:\Users\meschoenbaum\Desktop\ADSM_3_12\ADSM_3.4.44-RC5\src\ADSMSettings\xml2sqlite.py in readPopulation raise Exception( '%s is not a valid state' % state ) ... ▶ Local vars Request information
GET No GET data POST No POST data FILES Variable Value parameters_xml
<_io.TextIOWrapper name='<TemporaryUploadedFile: v3xml.xml (text/xml)> population_xml
<TemporaryUploadedFile: BarbaraNCPop.xml (text/xml)> COOKIES No cookie data META Variable Value REMOTE_ADDR '127.0.0.1' HTTP_CACHE_CONTROL
'max-age=0' QUERY_STRING
'' SERVER_NAME '127.0.0.1' wsgi.version
(1, 0) wsgi.run_once
False HTTP_ACCEPT_LANGUAGE
'en-us,en;q=0.8' HTTP_REFERER
'http://127.0.0.1:8000/app/ImportScenario/' REQUEST_URI '/app/ImportScenario/' PATH_INFO
'/app/ImportScenario/' HTTP_HOST
'127.0.0.1:8000' wsgi.multiprocess
False REQUEST_METHOD
'POST' SERVER_PORT '8001' HTTP_ORIGIN 'http://127.0.0.1:8000' ACTUAL_SERVER_PROTOCOL
'HTTP/1.1' wsgi.errors