Skip to content

Commit

Permalink
Made Run, Model, ModelVersion and Project made first class ci…
Browse files Browse the repository at this point in the history
…tizens (#1246)
  • Loading branch information
Raalsky committed Mar 7, 2023
1 parent af86b1e commit e0da79e
Show file tree
Hide file tree
Showing 28 changed files with 1,289 additions and 1,431 deletions.
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.

0 comments on commit e0da79e

Please sign in to comment.