SPARC-FAIR-Codeathon / sparc-me

A python tool to explore, enhance, and expand SPARC datasets and their descriptions
Apache License 2.0
7 stars 6 forks source link

API: Need to update Load dataset method #91

Closed LinkunGao closed 1 year ago

LinkunGao commented 1 year ago

Description

Currently there are a few things are not convinent:

  1. When we create a dataset we only can create a empty dataset first. Then we can use load function to decide if we load the existing dataset or create a new dataset.
  2. When we use dataset.add_data we always need to set the dataset path. This is not good, because if there is no existing data we don't kown where the dataset path. And also, when we use this function, there is already dataset loaded in program, so why we need to provide a dataset path here. logic error.

Solution

dataset = Dataset(path=None, from_template=False, version="2.0.0")

dataset = Dataset()
dataset.load(path=None, from_template=True, template_version="2.0.0")

// currently
dataset.load_dataset(path)
dataset.load_from_template()

Environment details:

Additional context

Add any other context about the problem here.