INT-NIT / BEP032tools

Software tools supporting the BIDS Extension Proposal (BEP) dedicated to adding support for electrophysiological data recorded in animal models (BEP032)
MIT License
3 stars 9 forks source link

Updated BEP032Generator.py to better handle BIDS entities #143

Closed SylvainTakerkart closed 1 year ago

SylvainTakerkart commented 1 year ago

This PR aims at handling the run and task values if given in the csv file that is given as input to the generate_bids_dataset function....

This has been tested / tried on a real use case, not provided here. It seems to be functional! So this should be ready for review and/or ready for the addition of better unit tests...

SylvainTakerkart commented 1 year ago

thanks!

I merged, tried to rerun what was working for me before, and got this error (maybe because run is a string?):

File "/home/takerkart/work/python/BEP032tools/bep032tools/generator/BEP032Generator.py", line 373, in generate_bids_dataset if run is not None and np.isnan(run): TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

JuliaSprenger commented 1 year ago

That's strange, that should have been fixed in https://github.com/INT-NIT/BEP032tools/pull/143/commits/72a0b538c9f238d58ebb0df150671cf3d068c7c7 and tests are also passing in main now. Do you still have the same error after pulling from INT-NIT/master?

SylvainTakerkart commented 1 year ago

I did pull... you can reproduce the error fairly simply with this piece of code:

    run = '0'
    if run is not None and np.isnan(run):
        run = None