spatialtopology / spacetop-prep

code for transferring data and preprocessing
MIT License
0 stars 3 forks source link

[BUG] argument int vs str #42

Closed spacetop-admin closed 1 year ago

spacetop-admin commented 1 year ago

Which module is this from?

physio

What is the issue?

python arguments, when feeding in numbers; they are handled as strings

What was your expected behavior?

To have the numeric arguments as numbers

How can we reproduce this?

If the argument is not explicitly designated, this error occurs Need to fix it with explicitly mentioning type=int

Any additional context?


  File "/Users/byeolkim/dropbox/Dartmouth/research/2022_Lux_IMENSA/scripts/physio/spacetop/c02_save_separate_run.py", line 261, in <module>
    main()
  File "/Users/byeolkim/dropbox/Dartmouth/research/2022_Lux_IMENSA/scripts/physio/spacetop/c02_save_separate_run.py", line 110, in main
    sub_list = utils.initialize.sublist(source_dir, remove_sub, slurm_id, stride, sub_zeropad)
  File "/Users/byeolkim/github/spacetop-prep/spacetop_prep/physio/utils/initialize.py", line 118, in sublist
    include_int = list(np.arange(slurm_id * stride + 1, (slurm_id + 1) * stride, 1))
TypeError: can only concatenate str (not "int") to str```
jungheejung commented 1 year ago

This may be due to a Mac OS or windows system issue, where the numeric variables are not read as numeric, but instead as strings. (Note: We did not see running on a linux system). Issue resolved with new commit e92a039: https://github.com/spatialtopology/spacetop-prep/blob/17108702d1e17d1777d310d9bf2129db8e2f2bf4/spacetop_prep/physio/c02_save_separate_run.py#L231-L252