Skip to content

Handle zeros in initial/evovling conditions files #388

@K20shores

Description

@K20shores

The attached configuration fails to run in version 2.9.1 because it has a zero set for the value of 'PHOTO.EMIS_NO2_emis' in the initial conditions file. This causes the setting of the state rate constants to fail with this error:

:: music_box -c /Users/kshores/Downloads/config_U101/temp/config/my_config.json
Traceback (most recent call last):
  File "/opt/homebrew/anaconda3/envs/musicbox/bin/music_box", line 8, in <module>
    sys.exit(main())
  File "/Users/kshores/Documents/music-box/src/acom_music_box/main.py", line 132, in main
    result = myBox.solve(callback=None)
  File "/Users/kshores/Documents/music-box/src/acom_music_box/music_box.py", line 117, in solve
    self.state.set_user_defined_rate_parameters(curr_conditions.rate_parameters)
  File "/opt/homebrew/anaconda3/envs/musicbox/lib/python3.9/site-packages/musica/types.py", line 161, in set_user_defined_rate_parameters
    if len(value) != self.__number_of_grid_cells:
TypeError: object of type 'numpy.int64' has no len()

Acceptance criteria

  • This configuration can run without failure

Ideas

  • Ensure any conditions we read in explicitly are set as np.float64

config.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions