Skip to content

update python SDK #22

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 5 commits into from
Feb 17, 2021
Merged

update python SDK #22

merged 5 commits into from
Feb 17, 2021

Conversation

nofel-scale
Copy link
Contributor

  • Update README
  • add Project API support
  • expand batch API support
  • update supported task types

Copy link
Contributor

@shaun-scale shaun-scale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the additions here, especially appreciate the extra tests, but we'll want to bring some of them back likely and add ones for the create_imageannotation_task type of methods.

README.md Outdated
Comment on lines 1 to 5
===================
Scale AI | Python SDK
===================

# Installation
Copy link
Contributor

@shaun-scale shaun-scale Feb 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file wasn't markdown before - we need to either change the syntax from the .rst file to .md, or save the file again as an .rst file.

The internet does make a reasonably strong case for documenting Python SDKs in .rst
https://eli.thegreenplace.net/2017/restructuredtext-vs-markdown-for-technical-documentation/
https://www.zverovich.net/2016/06/16/rst-vs-markdown.html#:~:text=Both%20are%20lightweight%20markup%20languages,So%20what%20are%20the%20differences%3F

But we're still pretty light-weight and I think 99% of the engineers here just use Markdown.. I'll let you figure out the lift and pros / cons of converting everything.

README.md Outdated

client.get_batch( batch_name = "batch_name_01_07_2021" )

## List Batchs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/sp batchs -> batches

Comment on lines 7 to 18
TASK_TYPES = [
'annotation',
'audiotranscription',
'categorization',
'comparison',
'cuboidannotation',
'datacollection',
'imageannotation',
'lineannotation',
'namedentityrecognition',
'pointannotation',
'polygonannotation',
'segmentannotation',
'transcription',
'documenttranscription',
'videoannotation',
'videoboxannotation',
'videocuboidannotation'
'videoplaybackannotation',
'namedentityrecognition',
'textcollection',
'documentmodel'
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nofel-scale you're actually missing a big part of why this array exists.

At the bottom of init.py, we have:

def _AddTaskTypeCreator(task_type):
    def create_task_wrapper(self, **kwargs):
        return self.create_task(task_type, **kwargs)
    setattr(ScaleClient, 'create_' + task_type + '_task', create_task_wrapper)
for taskType in TASK_TYPES:
    _AddTaskTypeCreator(taskType)

This allows the client to have client.create_imageannotation_task as a method, plus all the other task types. You can still use the raw create_task method for things like Lidar if you wanted, but we should call out in the readme that these other functions do exist. (You removed it for now)

Copy link
Contributor

@shaun-scale shaun-scale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great - thanks @nofel-scale

@shaun-scale shaun-scale merged commit cb3f839 into master Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants