Ana Paula Rojas
12/10/2023, 2:56 AMDeepyaman Datta
12/10/2023, 3:03 PMunittest.mock.patch
).Nok Lam Chan
12/10/2023, 5:05 PMDeepyaman Datta
12/11/2023, 1:40 AMOr you can just monkeypatch it, simple as dataset._load = your__load_func
(If you're using the dataset instance programmatically; won't work e.g. if using the YAML configuration) I guess maybe you could do the above in a before load hook...? But that's hacky AF. I'd do proper monkeypatching if really don't want to subclass. π
Ana Paula Rojas
12/11/2023, 2:09 AMAna Paula Rojas
12/11/2023, 2:24 AMmarrrcin
12/11/2023, 8:04 AMtype:
field (see 2.)Ana Paula Rojas
12/11/2023, 4:32 PMDeepyaman Datta
12/11/2023, 5:22 PMMy question is how can I use some new input that didnt exist in the Dataset that I was subclassing it.You need to overwrite the
__init__
method, if it's a new dataset argument (like filepath
). If it is a load and save argument, it's easier, because those data structures are already dicts, so flexible for accepting new values.Ana Paula Rojas
12/11/2023, 5:50 PM