Coretex
coretex.coretex.sample.network_sample.NetworkSample Class Reference
Inheritance diagram for coretex.coretex.sample.network_sample.NetworkSample:
coretex.coretex.sample.sample.Sample coretex.coretex.sample.custom_sample.custom_sample.CustomSample coretex.coretex.sample.image_sample.image_sample.ImageSample coretex.coretex.sample.image_segmentation_sample.image_segmentation_sample.ImageSegmentationSample

Public Member Functions

str path (self)
 
str zipPath (self)
 
bool download (self, bool ignoreCache=False)
 
- Public Member Functions inherited from coretex.coretex.sample.sample.Sample
None unzip (self, bool ignoreCache=False)
 
Path joinPath (self, Union[Path, str] other)
 

Detailed Description

    Represents a base class for all Sample classes which are
    comunicating with Coretex.ai

Definition at line 35 of file network_sample.py.

Member Function Documentation

◆ download()

bool coretex.coretex.sample.network_sample.NetworkSample.download (   self,
bool   ignoreCache = False 
)
    Downloads sample from Coretex.ai

    Returns
    -------
    bool -> False if response is failed, True otherwise

Reimplemented from coretex.coretex.sample.sample.Sample.

Definition at line 120 of file network_sample.py.

120  def download(self, ignoreCache: bool = False) -> bool:
121  """
122  Downloads sample from Coretex.ai
123 
124  Returns
125  -------
126  bool -> False if response is failed, True otherwise
127  """
128 
129  if os.path.exists(self.zipPath) and not ignoreCache:
130  return True
131 
132  response = networkManager.genericDownload(
133  endpoint = f"{self.__class__._endpoint()}/export?id={self.id}",
134  destination = self.zipPath
135  )
136 
137  return not response.hasFailed()
138 

◆ path()

str coretex.coretex.sample.network_sample.NetworkSample.path (   self)
    Returns
    -------
    str -> path for network sample

Reimplemented from coretex.coretex.sample.sample.Sample.

Definition at line 46 of file network_sample.py.

46  def path(self) -> str:
47  """
48  Returns
49  -------
50  str -> path for network sample
51  """
52 
53  return os.path.join(FolderManager.instance().samplesFolder, str(self.id))
54 

◆ zipPath()

str coretex.coretex.sample.network_sample.NetworkSample.zipPath (   self)
    Returns
    -------
    str -> zip path for network sample

Reimplemented from coretex.coretex.sample.sample.Sample.

Definition at line 56 of file network_sample.py.

56  def zipPath(self) -> str:
57  """
58  Returns
59  -------
60  str -> zip path for network sample
61  """
62 
63  return f"{self.path}.zip"
64 

The documentation for this class was generated from the following file: