Skip to content

Commit

Permalink
Merge pull request #56 from VukManojlovic/CTX-4624
Browse files Browse the repository at this point in the history
CTX-4624: Removed Dataset.add and sampleIds parameter fom Dataset.create
  • Loading branch information
igorperic17 authored Sep 12, 2023
2 parents c2a79a3 + 14150ce commit ecd5dd1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
17 changes: 0 additions & 17 deletions coretex/coretex/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,6 @@ def path(self) -> Path:
def download(self, ignoreCache: bool = False) -> None:
pass

def add(self, sample: SampleType) -> bool:
"""
Adds the specified sample into the dataset
Parameters
----------
sample : SampleType
sample which should be added into the dataset
Returns
-------
bool -> True if sample was added, False if sample was not added
"""

self.samples.append(sample)
return True

def rename(self, name: str) -> bool:
"""
Renames the dataset, if the provided name is
Expand Down
20 changes: 0 additions & 20 deletions coretex/coretex/dataset/network_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def createDataset(
cls,
name: str,
spaceId: int,
sampleIds: Optional[List[int]] = None,
meta: Optional[Dict[str, Any]] = None
) -> Optional[Self]:

Expand All @@ -122,8 +121,6 @@ def createDataset(
dataset name
spaceId : int
space for which the dataset will be created
samplesIds : List[int]
samples which should be added to dataset (if present)
Returns
-------
Expand All @@ -138,13 +135,9 @@ def createDataset(
print("Dataset created successfully")
"""

if sampleIds is None:
sampleIds = []

return cls.create({
"name": name,
"project_id": spaceId,
"sessions": sampleIds,
"meta": meta
})

Expand Down Expand Up @@ -185,19 +178,6 @@ def sampleDownloader(sample: SampleType) -> None:

processor.process()

def add(self, sample: SampleType) -> bool:
if self.isLocked or sample.isDeleted:
return False

success = self.update({
"sessions": [sample.id]
})

if success:
return super().add(sample)

return success

def rename(self, name: str) -> bool:
success = self.update({
"name": name
Expand Down

0 comments on commit ecd5dd1

Please sign in to comment.