-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MusicBox does not run the TS1 case correctly #293
Comments
TS1 used to run correctly, so perhaps the correct file got inadvertently swapped out at some point. |
Running the MusicBox tests modifies these two most recent files:
That is wrong. Those 2 files are both under git version control. |
@carl-drews #280 brought in code coverage for us. After that came in I made a series of commits which increased our test coverage. I also included a test for the waccm conversion tool . If running the tests changes a file, it may be that the tool updates files in the current directory. Perhaps that's what's going on? |
I'm also getting an error on this test:
|
Ah, to run the tests I just run |
Yes, the WACCM conversion test is the one that changes files: I will dig into that one . . . |
The change in CSV header format looks like this: The file generated by the WACCM test script has the incorrect format: This difference does not look difficult to correct. But I will correct the overwriting first. |
I have created a config directory for the WACCM example, and placed the test output there:
|
Corrected WACCM output so that headers have the reaction_type prefix: |
This issue is fixed as part of this branch: https://github.com/NCAR/music-box/tree/220-config-file-csv |
There seems to be a problem with the ts1 test case:
modeling2:/home/drews/MusicBox/music-box/src/acom_music_box> cat goMusicBox
#python3 main.py -vv --config examples/configs/analytical/my_config.json --output examples/configs/analytical/mySolution.csv
#music_box -vv --config examples/configs/analytical/my_config.json --output examples/configs/analytical/mySolution.csv
#music_box -vv --config examples/configs/flow_tube/my_config.json --output examples/configs/flow_tube/mySolution.csv
#music_box -vv --config examples/configs/carbon_bond_5/my_config.json --output examples/configs/carbon_bond_5/mySolution.csv
music_box -vv --config examples/configs/ts1/my_config.json --output examples/configs/ts1/mySolution.csv
modeling2:/home/drews/MusicBox/music-box/src/acom_music_box> ./goMusicBox
2024-12-12 15:09:17 - DEBUG - main.main - /home/drews/MusicBox/music-box/src/acom_music_box/main.py
2024-12-12 15:09:17 - INFO - main.main - Start time: 2024-12-12 15:09:17.619041
2024-12-12 15:09:17 - DEBUG - main.main - Working directory = /home/drews/MusicBox/music-box/src/acom_music_box
2024-12-12 15:09:17 - DEBUG - main.main - Configuration file = examples/configs/ts1/my_config.json
2024-12-12 15:09:17 - ERROR - conditions.read_initial_rates_from_file - Unexpected format in key: temperature [K]
Traceback (most recent call last):
File "/home/drews/.conda/envs/musicbox/bin/music_box", line 8, in
sys.exit(main())
^^^^^^
File "/home/drews/MusicBox/music-box/src/acom_music_box/main.py", line 127, in main
myBox.loadJson(musicBoxConfigFile)
File "/home/drews/MusicBox/music-box/src/acom_music_box/music_box.py", line 224, in loadJson
self.initial_conditions = Conditions.from_config_JSON(path_to_json, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/drews/MusicBox/music-box/src/acom_music_box/conditions.py", line 146, in from_config_JSON
reaction_rates = Conditions.read_initial_rates_from_file(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/drews/MusicBox/music-box/src/acom_music_box/conditions.py", line 195, in read_initial_rates_from_file
raise ValueError(error)
ValueError: Unexpected format in key: temperature [K]
modeling2:/home/drews/MusicBox/music-box/src/acom_music_box>
Here is the CSV file
modeling2:/home/drews/MusicBox/music-box/src/acom_music_box/examples/configs/ts1> vim initial_conditions.csv
The header row looks like this:
temperature [K],pressure [Pa],ALKNIT [mol m-3],BCARY [mol m-3],BENZENE [mol m-3],BIGALD [mol m-3],BIGALD1 [mol m-3],...
but the python code is expecting something more like this:
time.s,ENV.pressure.Pa,ENV.temperature.K,ENV.air_density.kg,USER.usr_DMS_OH,USER.usr_CO_OH,SURF.usr_NC4CH2OH_aer,SURF.usr_NTERPOOH_aer...
The text was updated successfully, but these errors were encountered: