Skip to content

Commit b59920f

Browse files
tigssTiger Sun
and
Tiger Sun
authored
Version change (#52)
* bump version to 2.8 following changes * add to the readme * fix lint * LINT? * fix pylint * modify lints Co-authored-by: Tiger Sun <tiger.sun@scaleapi.com>
1 parent 7f3311b commit b59920f

File tree

7 files changed

+34
-32
lines changed

7 files changed

+34
-32
lines changed

.pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
disable=
33
missing-module-docstring,
44
too-few-public-methods,
5+
too-many-public-methods,
56
too-many-locals,
67
too-many-arguments,
78
too-many-instance-attributes,

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ __ https://docs.scale.com/reference#project-creation
351351
352352
print(project.name) # Test_Project
353353
354-
Throws ``ScaleDuplicateResource`` exception if a project with the same name already exists.
354+
Specify ``rapid=true`` for Rapid projects and ``studio=true`` for Studio projects. Throws ``ScaleDuplicateResource`` exception if a project with the same name already exists.
355355

356356
Retrieve Project
357357
^^^^^^^^^^^^^^^^

scaleapi/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,8 @@ def create_training_task(
855855
e.g.. `TaskType.ImageAnnotation`
856856
**kwargs:
857857
The same set of parameters are expected with
858-
create_task function and an additional expected_response.
859-
Scale's API documentation.
858+
create_task function and an additional
859+
expected_response. Scale's API documentation.
860860
https://docs.scale.com/reference
861861
862862
Returns:

scaleapi/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "2.7.0"
1+
__version__ = "2.8.0"
22
__package_name__ = "scaleapi"

scaleapi/evaluation_tasks.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
1-
class EvaluationTask:
2-
"""EvaluationTask class, containing EvaluationTask information."""
1+
from scaleapi.quality_tasks import QualityTask
32

4-
def __init__(self, json, client):
5-
self._json = json
6-
self.id = json["id"]
7-
self.initial_response = getattr(json, "initial_response", None)
8-
self.expected_response = json["expected_response"]
9-
self._client = client
103

11-
def __hash__(self):
12-
return hash(self.id)
4+
class EvaluationTask(QualityTask):
5+
"""EvaluationTask class, containing EvaluationTask information."""
136

147
def __str__(self):
158
return f"EvaluationTask(id={self.id})"
169

1710
def __repr__(self):
1811
return f"EvaluationTask({self._json})"
19-
20-
def as_dict(self):
21-
"""Returns all attributes as a dictionary"""
22-
return self._json

scaleapi/quality_tasks.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
class QualityTask:
2+
"""Quality class to be inherited by training_tasks or
3+
evaluation_tasks."""
4+
5+
def __init__(self, json, client):
6+
self._json = json
7+
self.id = json["id"]
8+
self.initial_response = getattr(json, "initial_response", None)
9+
self.expected_response = json["expected_response"]
10+
self._client = client
11+
12+
def __hash__(self):
13+
return hash(self.id)
14+
15+
def __str__(self):
16+
return f"QualityTask(id={self.id})"
17+
18+
def __repr__(self):
19+
return f"QualityTask({self._json})"
20+
21+
def as_dict(self):
22+
"""Returns all attributes as a dictionary"""
23+
return self._json

scaleapi/training_tasks.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
1-
class TrainingTask:
2-
"""TrainingTask class, containing TrainingTask information."""
1+
from scaleapi.quality_tasks import QualityTask
32

4-
def __init__(self, json, client):
5-
self._json = json
6-
self.id = json["id"]
7-
self.initial_response = getattr(json, "initial_response", None)
8-
self.expected_response = json["expected_response"]
9-
self._client = client
103

11-
def __hash__(self):
12-
return hash(self.id)
4+
class TrainingTask(QualityTask):
5+
"""TrainingTask class, containing TrainingTask information."""
136

147
def __str__(self):
158
return f"TrainingTask(id={self.id})"
169

1710
def __repr__(self):
1811
return f"TrainingTask({self._json})"
19-
20-
def as_dict(self):
21-
"""Returns all attributes as a dictionary"""
22-
return self._json

0 commit comments

Comments
 (0)