Skip to content

Version change #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
disable=
missing-module-docstring,
too-few-public-methods,
too-many-public-methods,
too-many-locals,
too-many-arguments,
too-many-instance-attributes,
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ __ https://docs.scale.com/reference#project-creation

print(project.name) # Test_Project

Throws ``ScaleDuplicateResource`` exception if a project with the same name already exists.
Specify ``rapid=true`` for Rapid projects and ``studio=true`` for Studio projects. Throws ``ScaleDuplicateResource`` exception if a project with the same name already exists.

Retrieve Project
^^^^^^^^^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions scaleapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,8 +855,8 @@ def create_training_task(
e.g.. `TaskType.ImageAnnotation`
**kwargs:
The same set of parameters are expected with
create_task function and an additional expected_response.
Scale's API documentation.
create_task function and an additional
expected_response. Scale's API documentation.
https://docs.scale.com/reference

Returns:
Expand Down
2 changes: 1 addition & 1 deletion scaleapi/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "2.7.0"
__version__ = "2.8.0"
__package_name__ = "scaleapi"
17 changes: 3 additions & 14 deletions scaleapi/evaluation_tasks.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
class EvaluationTask:
"""EvaluationTask class, containing EvaluationTask information."""
from scaleapi.quality_tasks import QualityTask

def __init__(self, json, client):
self._json = json
self.id = json["id"]
self.initial_response = getattr(json, "initial_response", None)
self.expected_response = json["expected_response"]
self._client = client

def __hash__(self):
return hash(self.id)
class EvaluationTask(QualityTask):
"""EvaluationTask class, containing EvaluationTask information."""

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

def __repr__(self):
return f"EvaluationTask({self._json})"

def as_dict(self):
"""Returns all attributes as a dictionary"""
return self._json
23 changes: 23 additions & 0 deletions scaleapi/quality_tasks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class QualityTask:
"""Quality class to be inherited by training_tasks or
evaluation_tasks."""

def __init__(self, json, client):
self._json = json
self.id = json["id"]
self.initial_response = getattr(json, "initial_response", None)
self.expected_response = json["expected_response"]
self._client = client

def __hash__(self):
return hash(self.id)

def __str__(self):
return f"QualityTask(id={self.id})"

def __repr__(self):
return f"QualityTask({self._json})"

def as_dict(self):
"""Returns all attributes as a dictionary"""
return self._json
17 changes: 3 additions & 14 deletions scaleapi/training_tasks.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
class TrainingTask:
"""TrainingTask class, containing TrainingTask information."""
from scaleapi.quality_tasks import QualityTask

def __init__(self, json, client):
self._json = json
self.id = json["id"]
self.initial_response = getattr(json, "initial_response", None)
self.expected_response = json["expected_response"]
self._client = client

def __hash__(self):
return hash(self.id)
class TrainingTask(QualityTask):
"""TrainingTask class, containing TrainingTask information."""

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

def __repr__(self):
return f"TrainingTask({self._json})"

def as_dict(self):
"""Returns all attributes as a dictionary"""
return self._json