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

Remove model and version params #1223

Merged
merged 7 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
- Removed `init` function ([#1216](https://github.com/neptune-ai/neptune-client/pull/1216))
- Removed `get_last_run` function ([#1217](https://github.com/neptune-ai/neptune-client/pull/1217))
- Removed `run` parameter from `init_run` function ([#1218](https://github.com/neptune-ai/neptune-client/pull/1218))
- Removed `model` parameter from `init_model` function ([#1223](https://github.com/neptune-ai/neptune-client/pull/1223))
- Removed `version` parameter from `init_model_version function ([#1223](https://github.com/neptune-ai/neptune-client/pull/1223))
normandy7 marked this conversation as resolved.
Show resolved Hide resolved

## neptune-client 0.16.18

Expand Down
2 changes: 0 additions & 2 deletions src/neptune/internal/init/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@
)
from neptune.internal.operation_processors.factory import get_operation_processor
from neptune.internal.utils import verify_type
from neptune.internal.utils.deprecation import deprecated_parameter
from neptune.internal.utils.ping_background_job import PingBackgroundJob
from neptune.metadata_containers import Model
from neptune.types.mode import Mode


@deprecated_parameter(deprecated_kwarg_name="model", required_kwarg_name="with_id")
def init_model(
*,
with_id: Optional[str] = None,
Expand Down
2 changes: 0 additions & 2 deletions src/neptune/internal/init/model_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
)
from neptune.internal.operation_processors.factory import get_operation_processor
from neptune.internal.utils import verify_type
from neptune.internal.utils.deprecation import deprecated_parameter
from neptune.internal.utils.ping_background_job import PingBackgroundJob
from neptune.metadata_containers import (
Model,
Expand All @@ -47,7 +46,6 @@
from neptune.types.mode import Mode


@deprecated_parameter(deprecated_kwarg_name="version", required_kwarg_name="with_id")
def init_model_version(
*,
with_id: Optional[str] = None,
Expand Down
2 changes: 1 addition & 1 deletion src/neptune/metadata_containers/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def fetch_model_versions_table(self, columns: Optional[Iterable[str]] = None) ->
>>> import neptune

>>> # Initialize model with the ID "CLS-FOREST"
... model = neptune.init_model(model="CLS-FOREST")
... model = neptune.init_model(with_id="CLS-FOREST")

>>> # Fetch the metadata of all model versions as a pandas DataFrame
... model_versions_df = model.fetch_model_versions_table().to_pandas()
Expand Down
7 changes: 1 addition & 6 deletions tests/unit/neptune/new/client/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
API_TOKEN_ENV_NAME,
PROJECT_ENV_NAME,
)
from neptune.exceptions import (
NeptuneParametersCollision,
NeptuneWrongInitParametersException,
)
from neptune.exceptions import NeptuneWrongInitParametersException
from neptune.internal.backends.api_model import (
Attribute,
AttributeType,
Expand Down Expand Up @@ -104,8 +101,6 @@ def test_resume(self):
def test_wrong_parameters(self):
with self.assertRaises(NeptuneWrongInitParametersException):
init_model(with_id=None, key=None)
with self.assertRaises(NeptuneParametersCollision):
init_model(model="foo", with_id="foo")

def test_name_parameter(self):
with init_model(key="TRY", name="some_name") as exp:
Expand Down
5 changes: 0 additions & 5 deletions tests/unit/neptune/new/client/test_model_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
)
from neptune.exceptions import (
NeptuneOfflineModeChangeStageException,
NeptuneParametersCollision,
NeptuneWrongInitParametersException,
)
from neptune.internal.backends.api_model import (
Expand Down Expand Up @@ -130,10 +129,6 @@ def test_wrong_parameters(self):
with init_model_version(with_id=None, model=None):
pass

with self.assertRaises(NeptuneParametersCollision):
with init_model_version(version="foo", with_id="foo"):
pass

def test_change_stage(self):
with self.call_init() as exp:
exp.change_stage(stage="production")
Expand Down