Deepreg: Test + docs: dataset/loader/unpaired_loader

Created on 7 Jul 2020  路  5Comments  路  Source: DeepRegNet/DeepReg

Issue description

Unit tests for unpaired_laoder, in pytest style.

  • class UnpairedDataLoader

    • init, validate_data_files, sample_index_generator, close

Type of Issue

Please delete options that are not relevant.

  • [x] Documentation update
  • [x] Test request
  • [x] Linting request

What's the expected result?

Unit tests for class methods, lint and docs.

docs test

Most helpful comment

Hi @acasamitjana @mathpluscode, if any doubts please confer with @s-sd or refer to their tests - q thorough, close to 100%/100% coverage! They should allow for more clarity, if any doubts feel free to ping me 馃槃

All 5 comments

@acasamitjana @NMontanaBrown

I'd like to add some suggestions on how can we test this class, as I'm not sure it's obvious.

What we can do is to

  1. initialize a UnpairedDataLoader instance, using a toy config, check test_unpaired_labeled.py for example
  2. we test the function validate_Data_files by asserting it returns None as in case of errors, the return won't be None
  3. to test sample_index_generator, we can get one return and check output types, it should be int, int, list of two ints
  4. to test close i don't know, i suggest to skip it, @NMontanaBrown what do you think

To be safe, it might be better to test for both nifti and h5 file loaders

btw, i had some typos in sample_index_generator,

Hi @acasamitjana @mathpluscode, if any doubts please confer with @s-sd or refer to their tests - q thorough, close to 100%/100% coverage! They should allow for more clarity, if any doubts feel free to ping me 馃槃

@acasamitjana i believe @NMontanaBrown means this issue #125 !

I don't follow you now. What do you mean?

@acasamitjana oh l just link @s-sd 's issue as i thought @NMontanaBrown said it's an example of good testing. Nothing else ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mathpluscode picture mathpluscode  路  6Comments

mathpluscode picture mathpluscode  路  3Comments

NMontanaBrown picture NMontanaBrown  路  5Comments

NMontanaBrown picture NMontanaBrown  路  6Comments

YipengHu picture YipengHu  路  6Comments