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

Made Run, Model, ModelVersion and Project made first class citizens #1246

Merged
merged 29 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
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,3 +1,8 @@
## [UNRELEASED] neptune 1.1.0

### Features
- `Run`, `Model`, `ModelVersion` and `Project` could be created with constructor in addition to `init_*` functions ([#1246](https://github.com/neptune-ai/neptune-client/pull/1246))

## neptune 1.0.2

### Fixes
Expand Down
19 changes: 13 additions & 6 deletions src/neptune/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,27 @@
"init_project",
"init_run",
"Run",
"Model",
"ModelVersion",
"Project",
"__version__",
]


from neptune.common.patches import apply_patches
from neptune.constants import ANONYMOUS_API_TOKEN
from neptune.internal.init import (
init_model,
init_model_version,
init_project,
init_run,
from neptune.metadata_containers import (
Model,
ModelVersion,
Project,
Run,
)
from neptune.metadata_containers import Run
from neptune.version import __version__

# Apply patches of external libraries
apply_patches()

init_run = Run
init_model = Model
init_model_version = ModelVersion
init_project = Project
3 changes: 1 addition & 2 deletions src/neptune/internal/backends/neptune_backend_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
from neptune.internal.utils import base64_decode
from neptune.internal.utils.generic_attribute_mapper import NoValue
from neptune.internal.utils.paths import path_to_str
from neptune.metadata_containers import Model
from neptune.types import (
Boolean,
Integer,
Expand Down Expand Up @@ -268,7 +267,7 @@ def get_metadata_container(
elif expected_container_type == ContainerType.MODEL:
return ApiExperiment(
id=UniqueId(str(uuid.uuid4())),
type=Model.container_type,
type=ContainerType.MODEL,
sys_id=SysId(container_id.rsplit("/", 1)[-1]),
workspace=self.WORKSPACE_NAME,
project_name=self.PROJECT_NAME,
Expand Down
17 changes: 0 additions & 17 deletions src/neptune/internal/init/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,3 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__all__ = [
"init_model",
"init_model_version",
"init_project",
"init_run",
"Mode",
"RunMode",
]


from neptune.internal.init.model import init_model
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.types.mode import Mode

RunMode = Mode
146 changes: 0 additions & 146 deletions src/neptune/internal/init/model.py

This file was deleted.

141 changes: 0 additions & 141 deletions src/neptune/internal/init/model_version.py

This file was deleted.

Loading