Dataset name and root directory when loading from existing dataset
Issues
!42 (merged)
Issue 1 - solved withRoot directory seems to be saved in the dataset file as a local path. When the whole package is moved to a different location, dataset cannot be restored because it looks for files in a wrong (non-existent) location.
Issue 2
Currently, the dataset name and the folder name in which the data sample and the data object reside and the dataobject file name are strictly linked and inscribed in the pickled dataobject.
Required
The user should be able to move the whole package around, pass it on to other users/machines, and rename the top folder ad libitum.
Clarify:
- is there a scenario where we have different dataset objects for the same "dataset" (collection of data samples)?
Proposed solution
Issue 1
In Dataset
class:
- in
self.save_dataset_obj
: resetself.datapath = None
- in
self.load_dataset_obj
: update theself.datapath
with the current path
Issue 2
- folder name and dataset name should be separated. Locate a pickled/json'd dataset object using an explicit path.
Further proposition:
Probably a more elegant solution would be if the user could load the Dataset object from explicit file path.
Now (user needs to know the correct name of the dataset):
dataset = Dataset(name='myname', path=<mypath>)
dataset.load_dataset_obj()
Proposed:
dataset.load_dataset_obj(path=<mypath>)
(the dataset name is saved in the object)