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 init function #1216

Merged
merged 6 commits into from
Feb 13, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Moved modules from `neptune.new` to `neptune` with compatibility imports and marked `neptune.new` as deprecated ([#1213](https://github.com/neptune-ai/neptune-client/pull/1213))
- Removed `neptune.*` legacy modules ([#1206](https://github.com/neptune-ai/neptune-client/pull/1206))
- Removed `get_project` function ([#1214](https://github.com/neptune-ai/neptune-client/pull/1214))
- Removed `init` function ([#1216](https://github.com/neptune-ai/neptune-client/pull/1216))

## [UNRELEASED] neptune-client 0.16.18

Expand Down
2 changes: 0 additions & 2 deletions src/neptune/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
__all__ = [
"ANONYMOUS",
"ANONYMOUS_API_TOKEN",
"init",
"init_model",
"init_model_version",
"init_project",
Expand All @@ -35,7 +34,6 @@
)
from neptune.exceptions import NeptuneUninitializedException
from neptune.internal.init import (
init,
init_model,
init_model_version,
init_project,
Expand Down
4 changes: 2 additions & 2 deletions src/neptune/common/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(self):
- set as an environment variable in your operating system.

{h2}CODE{end}
Pass the token to the {bold}init(){end} method via the {bold}api_token{end} argument:
Pass the token to the {bold}init_run(){end} function via the {bold}api_token{end} argument:
{python}neptune.init_run(project='WORKSPACE_NAME/PROJECT_NAME', api_token='YOUR_API_TOKEN'){end}

{h2}ENVIRONMENT VARIABLE{end} {correct}(Recommended option){end}
Expand All @@ -110,7 +110,7 @@ def __init__(self):
In your CMD run:
{bash}set {env_api_token}="YOUR_API_TOKEN"{end}

and skip the {bold}api_token{end} argument of the {bold}init(){end} method:
and skip the {bold}api_token{end} argument of the {bold}init_run(){end} function:
{python}neptune.init_run(project='WORKSPACE_NAME/PROJECT_NAME'){end}

You may also want to check the following docs page:
Expand Down
10 changes: 5 additions & 5 deletions src/neptune/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def __init__(
- set an environment variable in your operating system.

{h2}CODE{end}
Pass it to the {bold}init(){end} method via the {bold}project{end} argument:
Pass it to the {bold}init_run(){end} function via the {bold}project{end} argument:
{python}neptune.init_run(project='WORKSPACE_NAME/PROJECT_NAME'){end}

{h2}ENVIRONMENT VARIABLE{end}
Expand All @@ -383,7 +383,7 @@ def __init__(
In your CMD run:
{bash}set {env_project}=WORKSPACE_NAME/PROJECT_NAME{end}

and skip the {bold}project{end} argument of the {bold}init(){end} method:
and skip the {bold}project{end} argument of the {bold}init_run(){end} function:
{python}neptune.init_run(){end}

You may also want to check the following docs pages:
Expand Down Expand Up @@ -490,7 +490,7 @@ def __init__(self):
- set an environment variable in your operating system.

{h2}CODE{end}
Pass the token to the {bold}init(){end} method via the {bold}api_token{end} argument:
Pass the token to the {bold}init_run(){end} function via the {bold}api_token{end} argument:
{python}neptune.init_run(project='WORKSPACE_NAME/PROJECT_NAME', api_token='YOUR_API_TOKEN'){end}

{h2}ENVIRONMENT VARIABLE{end} {correct}(Recommended option){end}
Expand All @@ -504,7 +504,7 @@ def __init__(self):
In your CMD run:
{bash}set {env_api_token}="YOUR_API_TOKEN"{end}

and skip the {bold}api_token{end} argument of the {bold}init(){end} method:
and skip the {bold}api_token{end} argument of the {bold}init_run(){end} function:
{python}neptune.init_run(project='WORKSPACE_NAME/PROJECT_NAME'){end}

You may also want to check the following docs pages:
Expand Down Expand Up @@ -689,7 +689,7 @@ def __init__(self, host):
What should I do?
- Check if your computer is connected to the internet.
- Check if your computer is supposed to be using a proxy to access the internet.
If so, you may want to use the {python}proxies{end} parameter of the {python}init(){end} method.
If so, you may want to use the {python}proxies{end} parameter of the {python}init_run(){end} function.
See https://docs.neptune.ai/api/universal/#proxies
and https://requests.readthedocs.io/en/latest/user/advanced/#proxies
- Check the status of Neptune services: https://status.neptune.ai/
Expand Down
2 changes: 1 addition & 1 deletion src/neptune/integrations/python_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class NeptuneHandler(logging.Handler):
"""Handler that sends the log records created by the logger to Neptune

Args:
run (Run): An existing run reference (as returned by `neptune.init`)
run (Run): An existing run reference (as returned by `neptune.init_run`)
Logger will send messages as a `StringSeries` field on this run.
level (int, optional): Log level of the handler. Defaults to `logging.NOTSET`,
which logs everything that matches logger's level.
Expand Down
7 changes: 0 additions & 7 deletions src/neptune/internal/init/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# limitations under the License.
#
__all__ = [
"init",
"init_model",
"init_model_version",
"init_project",
Expand All @@ -28,12 +27,6 @@
from neptune.internal.init.model_version import init_model_version
from neptune.internal.init.project import init_project
from neptune.internal.init.run import init_run
from neptune.internal.utils.deprecation import deprecated
from neptune.types.mode import Mode

RunMode = Mode


@deprecated(alternative="init_run")
def init(*args, **kwargs):
return init_run(*args, **kwargs)
2 changes: 0 additions & 2 deletions src/neptune/new/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"ANONYMOUS_API_TOKEN",
"NeptunePossibleLegacyUsageException",
"NeptuneUninitializedException",
"init",
"init_model",
"init_model_version",
"init_project",
Expand Down Expand Up @@ -54,7 +53,6 @@
Run,
__version__,
get_last_run,
init,
init_model,
init_model_version,
init_project,
Expand Down
4 changes: 0 additions & 4 deletions tests/unit/neptune/new/test_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from neptune import (
ANONYMOUS,
Run,
init,
init_model,
init_model_version,
init_project,
Expand Down Expand Up @@ -63,9 +62,6 @@ def get_experiments(cls, flush_period=None):
if flush_period is not None:
kwargs["flush_period"] = flush_period

with init(**kwargs) as run:
yield run

with init_run(**kwargs) as run:
yield run

Expand Down