sizespectrum / therMizer

1 stars 1 forks source link

No case when the user doesn't supply a `vertical_migration_array` #3

Closed baldrech closed 1 year ago

baldrech commented 1 year ago

There is no case when the user doesn't supply a vertical_migration_array at the moment.

What are the rules for the realms? Does one need to have the same amount of columns within vertical_migration_array and ocean_temp_array. I'm guessing yes so if we assume the user comes up with just one set of temperatures within ocean_temp_array, we have two possibilities to handle that:

  1. We code a case where vertical_migration_array is not used but it means we need to adapt the code to work in 2D instead of just 3D.
  2. We automate the creation of a dummy vertical_migration_array that has not effects on the species physiology.

I think the latter would be easier but what would the vertical_migration_array look like then?

Also, with an `ocean_temp_array supplied as a vector, we could turn it into an array just by duplicating it by the number of species.

What do you think @pwoodworth-jefcoats ?

pwoodworth-jefcoats commented 1 year ago

I agree that automating the creation of a dummy vertical_migration_array is the probably the better solution. There are a few options for what the array would look like.

If a single ocean_temp_array vector is supplied, then realm names would be the same as species names, and vertical_migration would be 1 for all sizes for a given species/realm.

If an ocean_temp_array is supplied that has realm names that differ from species names, the I'd allocate species equally across all realms, and use the same value for all sizes. It would also be good to include a warning message about this. Something like, "Your realm names don't match your species names, so species are assumed to spend equal time in all realms."

Also, if an exposure_array is supplied but not a vertical_migration_array, then exposure could be used to inform the realms to which species are exposed, again with with the same value across all sizes.

Does this make sense? Would it work?

baldrech commented 1 year ago

Just one question, if there are conflicts between ocean_temp_array and exposure_array regarding the number/names of realms, which one will be used to create the vertical_migration_array?

pwoodworth-jefcoats commented 1 year ago

Could we have this result in an error that prompts the user to fix one or the other? Something like, 'The realms used in the ocean_temp_array and the exposure_array must match." We could do the same for ocean_temp_array and vertical_migration_array.

baldrech commented 1 year ago

eb97208 covers all possibilities (9 cases to my knowledge) of missing arrays and mismatching names between ocean_temp_array, vertical_migration_array and exposure_array. Feel free to play with it to find bugs and/or more cases!