Skip to content

Extant_sp's default value leads to a traceback error #4

Description

@shelleylwang

If the user does not define the '"extant_sp" parameter as an integer/float within the config file (using the edit_config() function), it will default to "NA", as specified in the DeepDiveR create_config.R file here:
sims$extant_sp <- NA # min/max number of living species

Then, when you try to run deepdive on that config file, extant_sp=NA will lead to this error:
File "..(filepath_here)deepdive\deepdive\deepdiver_utilities.py", line 51, in create_sim_obj_from_config
minEXTANT_SP=np.min(list(map(float, config["simulations"]["extant_sp"].split()))), # min number of living species
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: 'NA'

This is because of these two lines in deepdiver_utilities.py, which require that "extant_sp" be a float:
minEXTANT_SP=np.min(list(map(float, config["simulations"]["extant_sp"].split()))), # min number of living species
maxEXTANT_SP=np.max(list(map(float, config["simulations"]["extant_sp"].split()))),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions