Skip to content
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

Reimplement MortalityType enumerator #401

Open
chaukap opened this issue Dec 2, 2019 · 0 comments
Open

Reimplement MortalityType enumerator #401

chaukap opened this issue Dec 2, 2019 · 0 comments

Comments

@chaukap
Copy link
Contributor

chaukap commented Dec 2, 2019

The MortalityType enumerator, defined in ST_defines.h, is inconsistently used throughout the codebase. There are multiple instances where it is passed to a function but never used, and some places where hard-coded numerics are used in place of the actual enumerator. Here are all of the problems I could find:

Unused parameter

  • indiv_Kill_Partial accepts a MortalityType parameter but it is never used.

Incorrect usage

  • indiv_proportion_Kill accepts an int called killType, which is undoubtably intended to be a MortalityType value. In addition, killType is never used.
  • indiv_proportion_Recovery accepts an int called killType, which is undoubtably intended to be a MortalityType value. In addition, killType is never used.
  • indiv_Kill_Complete accepts an int called killType, which is undoubtably intended to be a MortalityType value. In addition, killType is never used.
  • Species_Proportion_Recovery accepts an int called killType, which is undoubtably intended to be a MortalityType value. killType is then passed to indiv_proportion_Recovery, which is listed above.
  • Species_Kill accepts an int called killType, which is undoubtably intended to be a MortalityType value. killType is then passed to indiv_Kill_Complete, which is listed above.
  • insertKillTypes in ST_sql.c is intended to insert the MortalityType codes and their meaning into the SQL database. One problem is that the values are hard-coded, so any changes to the MortalityType struct would not be reflected. Another problem is that we need to be consistent with our naming conventions (KillType vs MortalityType).

Correct usage

In the indiv_st struct a MortalityType field is declared.

@chaukap chaukap added this to the Unused features milestone Dec 2, 2019
@kpalmqui kpalmqui assigned alexisBelt and unassigned alexisBelt Mar 1, 2024
@kpalmqui kpalmqui removed this from the remove_unused_features milestone Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants