VSainteuf / pastis-benchmark

MIT License
195 stars 38 forks source link

Maybe there is a bug about the initialization of self.mono_date? #16

Closed DavidZhang88 closed 2 years ago

DavidZhang88 commented 2 years ago

Dear Vivien, Thank you so much for your generous sharing pastisR datasets, However, when I try to load the dataset, I found maybe there is a bug of the dataloader.py about self.mono_date. Beacause in the demo.ipynb, the default mono_date = None, thus there will be:

     89 self.mono_date = (
     90         datetime(*map(int, mono_date.split("-")))
---> 91         if "-" in mono_date
     92         else int(mono_date))

TypeError: argument of type 'NoneType' is not iterable

I think it's caused by your correction in #14, To fix this problem, I make a simple alteration:

if mono_date != None:
            self.mono_date = (
                datetime(*map(int, mono_date.split("-")))
                if "-" in mono_date
                else int(mono_date))
else:
            self.mono_date = None

Then it worked, my idea is not necessarily correct, just for your reference. Thank you for your sharing again! ^_^

VSainteuf commented 2 years ago

Hi @DavidZhang88, Thanks for pointing this out, your solution makes sense. I'll fix this shortly. Cheers