Skip to content

Commit c4c4793

Browse files
authored
Clean up NucleusClient interface and strengthen object model (#153)
See `CHANGELOG.md` for additions and deprecations
1 parent 7a84003 commit c4c4793

20 files changed

+757
-411
lines changed

.flake8

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,36 @@ ignore = E203, E266, E501, W503, F403, F401
33
max-line-length = 79
44
max-complexity = 18
55
select = B,C,E,F,W,T4,B9
6-
6+
exclude =
7+
# All of these excludes should mirror something in .gitignore
8+
.git,
9+
__pychache__,
10+
# Virtual env stuff
11+
./venv,
12+
.env,
13+
.venv,
14+
env/,
15+
venv/,
16+
ENV/,
17+
env.bak/,
18+
venv.bak/,
19+
# Distribution / packaging
20+
.Python,
21+
build/,
22+
develop-eggs/,
23+
dist/,
24+
downloads/,
25+
eggs/,
26+
.eggs/,
27+
lib/,
28+
lib64/,
29+
parts/,
30+
sdist/,
31+
var/,
32+
wheels/,
33+
pip-wheel-metadata/,
34+
share/python-wheels/,
35+
*.egg-info/,
36+
.installed.cfg,
37+
*.egg,
38+
MANIFEST

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,6 @@ poetry.lock
138138

139139
# vscode
140140
.vscode/
141+
142+
# JetBrains
143+
.idea/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repos:
1212
hooks:
1313
- id: system
1414
name: flake8
15-
entry: poetry run flake8 .
15+
entry: poetry run flake8 nucleus tests
1616
pass_filenames: false
1717
language: system
1818

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Changelog
2+
All notable changes to the [Nucleus Python Client](https://github.com/scaleapi/nucleus-python-client) will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [0.3.0](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.3.0) - 2021-11-23
8+
9+
### Added
10+
- `NucleusClient.datasets` property that lists Datasets in a human friendlier manner than `NucleusClient.list_datasets()`
11+
- `NucleusClient.models` property, this is preferred over the deprecated `list_models`
12+
- `NucleusClient.jobs` property. `NucleusClient.list_jobs` is still the preferred method to use if you filter jobs on access.
13+
- Deprecated method access now produces a deprecation warning in the logs.
14+
15+
### Deprecated
16+
- Model runs have been deprecated and will be removed in the near future. Use a Model directly instead. The following
17+
functions have all been deprecated as a part of that.
18+
- `NucleusClient.get_model_run(..)`
19+
- `NucleusClient.delete_model_run(..)`
20+
- `NucleusClient.create_model_run(..)`
21+
- `NucleusClient.commit_model_run(..)`
22+
- `NucleusClient.model_run_info(..)`
23+
- `NucleusClient.predictions_ref_id(..)`
24+
- `NucleusClient.predictions_iloc(..)`
25+
- `NucleusClient.predictions_loc(..)`
26+
- `Dataset.create_model_run(..)`
27+
- `Dataset.model_runs(..)`
28+
- `NucleusClient.list_datasets` is deprecated in favor of `NucleusClient.datasets`. The latter allows for direct usage of `Dataset` objects.
29+
- `NucleusClient.list_models` is deprecated in favor of `NucleusClient.models`.
30+
- `NucleusClient.get_dataset_items` is deprecated in favor of `Dataset.items` to make the object model more consistent.
31+
- `NucleusClient.delete_dataset_item` is deprecated in favor of `Dataset.delete_item` to make the object model more consistent.
32+
- `NucleusClient.populate_dataset` is deprecated in favor of `Dataset.append` to make the object model more consistent.
33+
- `NucleusClient.ingest_tasks` is deprecated in favor of `Dataset.ingest_tasks` to make the object model more consistent.
34+
- `NucleusClient.add_model` is deprecated in favor of `NucleusClient.create_model` for consistent terminology.
35+
- `NucleusClient.dataset_info` is deprecated in favor of `Dataset.info` to make the object model more consistent.
36+
- `NucleusClient.delete_annotations` is deprecated in favor of `Dataset.delete_annotations` to make the object model more consistent.
37+
- `NucleusClient.predict` is deprecated in favor of `Dataset.upload_predictions` to make the object model more consistent.
38+
- `NucleusClient.dataitem_ref_id` is deprecated in favor of `Dataset.refloc` to make the object model more consistent.
39+
- `NucleusClient.dataitem_iloc` is deprecated in favor of `Dataset.iloc` to make the object model more consistent.
40+
- `NucleusClient.dataitem_loc` is deprecated in favor of `Dataset.loc` to make the object model more consistent.
41+
- `NucleusClient.create_slice` is deprecated in favor of `Dataset.create_slice` to make the object model more consistent.
42+
- `NucleusClient.create_custom_index` is deprecated in favor of `Dataset.create_custom_index` to make the object model more consistent.
43+
- `NucleusClient.delete_custom_index` is deprecated in favor of `Dataset.delete_custom_index` to make the object model more consistent.
44+
- `NucleusClient.set_continuous_indexing` is deprecated in favor of `Dataset.set_continuous_indexing` to make the object model more consistent.
45+
- `NucleusClient.create_image_index` is deprecated in favor of `Dataset.create_image_index` to make the object model more consistent.
46+
- `NucleusClient.create_object_index` is deprecated in favor of `Dataset.create_object_index` to make the object model more consistent.
47+
- `Dataset.append_scenes` is deprecated in favor of `Dataset.append` for a simpler interface.
48+
49+
## [0.0.1 - 0.2.1](https://github.com/scaleapi/nucleus-python-client/releases)
50+
51+
[Refer to GitHub release notes for older releases.](https://github.com/scaleapi/nucleus-python-client/releases)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Please install the pre-commit hooks by running the following command:
4747
poetry run pre-commit install
4848
```
4949

50+
When releasing a new version please add release notes to the changelog in `CHANGELOG.md`.
51+
5052
**Best practices for testing:**
5153
(1). Please run pytest from the root directory of the repo, i.e.
5254

conftest.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import logging
21
import os
32

4-
import requests
53
import pytest
64

75
import nucleus
8-
from nucleus.constants import SUCCESS_STATUS_CODES
9-
106
from tests.helpers import TEST_DATASET_NAME, TEST_DATASET_ITEMS
117

128
assert "NUCLEUS_PYTEST_API_KEY" in os.environ, (

0 commit comments

Comments
 (0)