Skip to content
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

Added models get-training and models get-data-bundle #105

Merged
merged 1 commit into from
Nov 2, 2023
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Version 12.2.0 - 2023-11-02

- Added `models get-data-bundle`
- Added `models get-training`

## Version 12.1.0 - 2023-11-01

- Updated `--create-default-workflow` in `workflows create-default` to use the latest docker images and automatically
Expand Down
2 changes: 1 addition & 1 deletion lascli/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
__maintainer_email__ = 'magnus@lucidtech.ai'
__title__ = 'lucidtech-las-cli'
__url__ = 'https://github.com/LucidtechAI/las-cli'
__version__ = '12.1.0'
__version__ = '12.2.0'
18 changes: 18 additions & 0 deletions lascli/parser/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def create_data_bundle(las_client: Client, model_id, dataset_ids, **optional_arg
return las_client.create_data_bundle(model_id=model_id, dataset_ids=dataset_ids, **optional_args)


def get_data_bundle(las_client: Client, model_id, data_bundle_id):
return las_client.get_data_bundle(model_id=model_id, data_bundle_id=data_bundle_id)


def list_data_bundles(las_client: Client, model_id, max_results, next_token):
return las_client.list_data_bundles(model_id, max_results=max_results, next_token=next_token)

Expand All @@ -67,6 +71,10 @@ def create_training(las_client: Client, model_id, data_bundle_ids, data_scientis
)


def get_training(las_client: Client, model_id, training_id):
return las_client.get_training(model_id=model_id, training_id=training_id)


def list_trainings(las_client: Client, model_id, max_results, next_token):
return las_client.list_trainings(model_id, max_results=max_results, next_token=next_token)

Expand Down Expand Up @@ -203,6 +211,11 @@ def create_models_parser(subparsers):
create_data_bundle_parser.add_argument('--description')
create_data_bundle_parser.set_defaults(cmd=create_data_bundle)

get_data_bundle_parser = subparsers.add_parser('get-data-bundle')
get_data_bundle_parser.add_argument('model_id')
get_data_bundle_parser.add_argument('data_bundle_id')
get_data_bundle_parser.set_defaults(cmd=get_data_bundle)

list_data_bundles_parser = subparsers.add_parser('list-data-bundles')
list_data_bundles_parser.add_argument('model_id')
list_data_bundles_parser.add_argument('--max-results', '-m', type=int, default=None)
Expand Down Expand Up @@ -237,6 +250,11 @@ def create_models_parser(subparsers):
create_training_parser.add_argument('--data-scientist-assistance', action='store_true')
create_training_parser.set_defaults(cmd=create_training)

get_training_parser = subparsers.add_parser('get-training')
get_training_parser.add_argument('model_id')
get_training_parser.add_argument('training_id')
get_training_parser.set_defaults(cmd=get_training)

list_trainings_parser = subparsers.add_parser('list-trainings')
list_trainings_parser.add_argument('model_id')
list_trainings_parser.add_argument('--max-results', '-m', type=int, default=None)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ PyYAML>=6.0.0
argcomplete>=2.0.0
dateparser>=1.1.1
filetype>=1.0.13
lucidtech-las~=10.0
lucidtech-las~=10.1
10 changes: 10 additions & 0 deletions tests/test_data_bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ def test_data_bundles_create(parser, client, dataset_ids, name_and_description):
*name_and_description,
]
util.main_parser(parser, client, args)


def test_data_bundles_get(parser, client):
args = [
'models',
'get-data-bundle',
service.create_model_id(),
service.create_data_bundle_id(),
]
util.main_parser(parser, client, args)


def test_data_bundles_list(parser, client, list_defaults):
Expand Down
10 changes: 10 additions & 0 deletions tests/test_trainings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ def test_trainings_create(parser, client, data_scientist_assistance, data_bundle
util.main_parser(parser, client, args)


def test_trainings_get(parser, client):
args = [
'models',
'get-training',
service.create_model_id(),
service.create_training_id(),
]
util.main_parser(parser, client, args)


def test_trainings_list(parser, client, list_defaults):
args = [
'models',
Expand Down
Loading