File tree 7 files changed +34
-32
lines changed
7 files changed +34
-32
lines changed Original file line number Diff line number Diff line change 2
2
disable =
3
3
missing-module-docstring,
4
4
too-few-public-methods,
5
+ too-many-public-methods,
5
6
too-many-locals,
6
7
too-many-arguments,
7
8
too-many-instance-attributes,
Original file line number Diff line number Diff line change @@ -351,7 +351,7 @@ __ https://docs.scale.com/reference#project-creation
351
351
352
352
print (project.name) # Test_Project
353
353
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.
355
355
356
356
Retrieve Project
357
357
^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -855,8 +855,8 @@ def create_training_task(
855
855
e.g.. `TaskType.ImageAnnotation`
856
856
**kwargs:
857
857
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.
860
860
https://docs.scale.com/reference
861
861
862
862
Returns:
Original file line number Diff line number Diff line change 1
- __version__ = "2.7 .0"
1
+ __version__ = "2.8 .0"
2
2
__package_name__ = "scaleapi"
Original file line number Diff line number Diff line change 1
- class EvaluationTask :
2
- """EvaluationTask class, containing EvaluationTask information."""
1
+ from scaleapi .quality_tasks import QualityTask
3
2
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
10
3
11
- def __hash__ ( self ):
12
- return hash ( self . id )
4
+ class EvaluationTask ( QualityTask ):
5
+ """EvaluationTask class, containing EvaluationTask information."""
13
6
14
7
def __str__ (self ):
15
8
return f"EvaluationTask(id={ self .id } )"
16
9
17
10
def __repr__ (self ):
18
11
return f"EvaluationTask({ self ._json } )"
19
-
20
- def as_dict (self ):
21
- """Returns all attributes as a dictionary"""
22
- return self ._json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change 1
- class TrainingTask :
2
- """TrainingTask class, containing TrainingTask information."""
1
+ from scaleapi .quality_tasks import QualityTask
3
2
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
10
3
11
- def __hash__ ( self ):
12
- return hash ( self . id )
4
+ class TrainingTask ( QualityTask ):
5
+ """TrainingTask class, containing TrainingTask information."""
13
6
14
7
def __str__ (self ):
15
8
return f"TrainingTask(id={ self .id } )"
16
9
17
10
def __repr__ (self ):
18
11
return f"TrainingTask({ self ._json } )"
19
-
20
- def as_dict (self ):
21
- """Returns all attributes as a dictionary"""
22
- return self ._json
You can’t perform that action at this time.
0 commit comments