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

Introduce API v1 #630

Merged
merged 23 commits into from
Jan 31, 2022
Merged

Introduce API v1 #630

merged 23 commits into from
Jan 31, 2022

Conversation

zhiltsov-max
Copy link
Contributor

@zhiltsov-max zhiltsov-max commented Jan 21, 2022

Summary

Resolves #133

Introduces comfortable library API. For external use, the recommended way to call Datumaro API is:

import datumaro as dm
  • Added HLops module with some CLI command duplicates
  • Added more function docs
  • Some Dataset method parameters became kw-only
  • Updated examples in docs
  • Removed compatibility symbols for annotation classes in components.extractor

Remaining:

  • Check how docs look like

How to test

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

@zhiltsov-max zhiltsov-max force-pushed the zm/api-v1 branch 2 times, most recently from a4673e7 to 1611c23 Compare January 21, 2022 11:23
@zhiltsov-max zhiltsov-max changed the title [WIP] API v1 Introduce API v1 Jan 21, 2022
datumaro/components/dataset.py Outdated Show resolved Hide resolved
datumaro/components/dataset.py Outdated Show resolved Hide resolved
datumaro/components/dataset.py Outdated Show resolved Hide resolved
datumaro/components/dataset.py Outdated Show resolved Hide resolved
datumaro/components/dataset.py Outdated Show resolved Hide resolved
datumaro/components/dataset.py Outdated Show resolved Hide resolved
datumaro/components/dataset.py Outdated Show resolved Hide resolved
datumaro/components/operations.py Outdated Show resolved Hide resolved
datumaro/components/operations.py Outdated Show resolved Hide resolved
datumaro/__init__.py Outdated Show resolved Hide resolved
datumaro/components/hl_ops.py Show resolved Hide resolved
datumaro/components/hl_ops.py Outdated Show resolved Hide resolved
datumaro/components/hl_ops.py Outdated Show resolved Hide resolved
return Dataset(source=produced, env=env)

def filter(dataset: IDataset, expr: str, *, #pylint: disable=redefined-builtin
filter_annotations: bool = False,
Copy link

Choose a reason for hiding this comment

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

IMO, the fact that different values of this function select completely different implementations suggests that this function should be split into two, filter_items and filter_annotations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was done so some time ago, but it wasn't very comfortable to use. I'll reconsider such option.

datumaro/components/hl_ops.py Outdated Show resolved Hide resolved
datumaro/components/hl_ops.py Outdated Show resolved Hide resolved
datumaro/components/hl_ops.py Outdated Show resolved Hide resolved
datumaro/components/hl_ops.py Outdated Show resolved Hide resolved
datumaro/components/hl_ops.py Outdated Show resolved Hide resolved
tests/test_dataset.py Outdated Show resolved Hide resolved
tests/test_validator.py Outdated Show resolved Hide resolved
tests/test_validator.py Outdated Show resolved Hide resolved
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.

Introduce stable library API
2 participants