nextmv 0.26.3__tar.gz → 0.28.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. {nextmv-0.26.3 → nextmv-0.28.0}/.gitignore +3 -0
  2. {nextmv-0.26.3 → nextmv-0.28.0}/PKG-INFO +1 -1
  3. nextmv-0.28.0/nextmv/__about__.py +1 -0
  4. {nextmv-0.26.3 → nextmv-0.28.0}/nextmv/__entrypoint__.py +3 -5
  5. {nextmv-0.26.3 → nextmv-0.28.0}/nextmv/__init__.py +1 -0
  6. nextmv-0.28.0/nextmv/base_model.py +90 -0
  7. {nextmv-0.26.3 → nextmv-0.28.0}/nextmv/cloud/__init__.py +3 -0
  8. nextmv-0.28.0/nextmv/cloud/acceptance_test.py +948 -0
  9. nextmv-0.28.0/nextmv/cloud/account.py +213 -0
  10. {nextmv-0.26.3 → nextmv-0.28.0}/nextmv/cloud/application.py +1231 -396
  11. nextmv-0.28.0/nextmv/cloud/batch_experiment.py +217 -0
  12. nextmv-0.28.0/nextmv/cloud/client.py +452 -0
  13. nextmv-0.28.0/nextmv/cloud/input_set.py +143 -0
  14. nextmv-0.28.0/nextmv/cloud/instance.py +126 -0
  15. nextmv-0.28.0/nextmv/cloud/manifest.py +921 -0
  16. {nextmv-0.26.3 → nextmv-0.28.0}/nextmv/cloud/package.py +2 -2
  17. nextmv-0.28.0/nextmv/cloud/run.py +671 -0
  18. {nextmv-0.26.3 → nextmv-0.28.0}/nextmv/cloud/safe.py +7 -7
  19. nextmv-0.28.0/nextmv/cloud/scenario.py +414 -0
  20. nextmv-0.28.0/nextmv/cloud/secrets.py +234 -0
  21. nextmv-0.28.0/nextmv/cloud/status.py +122 -0
  22. nextmv-0.28.0/nextmv/cloud/version.py +174 -0
  23. nextmv-0.28.0/nextmv/deprecated.py +47 -0
  24. {nextmv-0.26.3 → nextmv-0.28.0}/nextmv/input.py +300 -82
  25. nextmv-0.28.0/nextmv/logger.py +111 -0
  26. nextmv-0.28.0/nextmv/model.py +423 -0
  27. {nextmv-0.26.3 → nextmv-0.28.0}/nextmv/options.py +301 -69
  28. nextmv-0.28.0/nextmv/output.py +1149 -0
  29. nextmv-0.28.0/tests/cloud/app.yaml +45 -0
  30. {nextmv-0.26.3 → nextmv-0.28.0}/tests/cloud/test_application.py +3 -2
  31. {nextmv-0.26.3 → nextmv-0.28.0}/tests/cloud/test_manifest.py +19 -16
  32. {nextmv-0.26.3 → nextmv-0.28.0}/tests/cloud/test_safe_name_id.py +2 -2
  33. {nextmv-0.26.3 → nextmv-0.28.0}/tests/test_output.py +228 -57
  34. nextmv-0.26.3/nextmv/__about__.py +0 -1
  35. nextmv-0.26.3/nextmv/base_model.py +0 -45
  36. nextmv-0.26.3/nextmv/cloud/acceptance_test.py +0 -257
  37. nextmv-0.26.3/nextmv/cloud/account.py +0 -68
  38. nextmv-0.26.3/nextmv/cloud/batch_experiment.py +0 -105
  39. nextmv-0.26.3/nextmv/cloud/client.py +0 -258
  40. nextmv-0.26.3/nextmv/cloud/input_set.py +0 -50
  41. nextmv-0.26.3/nextmv/cloud/instance.py +0 -40
  42. nextmv-0.26.3/nextmv/cloud/manifest.py +0 -383
  43. nextmv-0.26.3/nextmv/cloud/run.py +0 -340
  44. nextmv-0.26.3/nextmv/cloud/scenario.py +0 -229
  45. nextmv-0.26.3/nextmv/cloud/secrets.py +0 -61
  46. nextmv-0.26.3/nextmv/cloud/status.py +0 -29
  47. nextmv-0.26.3/nextmv/cloud/version.py +0 -46
  48. nextmv-0.26.3/nextmv/deprecated.py +0 -13
  49. nextmv-0.26.3/nextmv/logger.py +0 -47
  50. nextmv-0.26.3/nextmv/model.py +0 -256
  51. nextmv-0.26.3/nextmv/output.py +0 -718
  52. nextmv-0.26.3/tests/cloud/app.yaml +0 -43
  53. {nextmv-0.26.3 → nextmv-0.28.0}/LICENSE +0 -0
  54. {nextmv-0.26.3 → nextmv-0.28.0}/README.md +0 -0
  55. {nextmv-0.26.3 → nextmv-0.28.0}/pyproject.toml +0 -0
  56. {nextmv-0.26.3 → nextmv-0.28.0}/requirements.txt +0 -0
  57. {nextmv-0.26.3 → nextmv-0.28.0}/tests/__init__.py +0 -0
  58. {nextmv-0.26.3 → nextmv-0.28.0}/tests/cloud/__init__.py +0 -0
  59. {nextmv-0.26.3 → nextmv-0.28.0}/tests/cloud/test_client.py +0 -0
  60. {nextmv-0.26.3 → nextmv-0.28.0}/tests/cloud/test_package.py +0 -0
  61. {nextmv-0.26.3 → nextmv-0.28.0}/tests/cloud/test_run.py +0 -0
  62. {nextmv-0.26.3 → nextmv-0.28.0}/tests/cloud/test_scenario.py +0 -0
  63. {nextmv-0.26.3 → nextmv-0.28.0}/tests/scripts/__init__.py +0 -0
  64. {nextmv-0.26.3 → nextmv-0.28.0}/tests/scripts/options1.py +0 -0
  65. {nextmv-0.26.3 → nextmv-0.28.0}/tests/scripts/options2.py +0 -0
  66. {nextmv-0.26.3 → nextmv-0.28.0}/tests/scripts/options3.py +0 -0
  67. {nextmv-0.26.3 → nextmv-0.28.0}/tests/scripts/options4.py +0 -0
  68. {nextmv-0.26.3 → nextmv-0.28.0}/tests/scripts/options5.py +0 -0
  69. {nextmv-0.26.3 → nextmv-0.28.0}/tests/scripts/options6.py +0 -0
  70. {nextmv-0.26.3 → nextmv-0.28.0}/tests/scripts/options7.py +0 -0
  71. {nextmv-0.26.3 → nextmv-0.28.0}/tests/scripts/options_deprecated.py +0 -0
  72. {nextmv-0.26.3 → nextmv-0.28.0}/tests/test_base_model.py +0 -0
  73. {nextmv-0.26.3 → nextmv-0.28.0}/tests/test_entrypoint/__init__.py +0 -0
  74. {nextmv-0.26.3 → nextmv-0.28.0}/tests/test_entrypoint/test_entrypoint.py +0 -0
  75. {nextmv-0.26.3 → nextmv-0.28.0}/tests/test_input.py +0 -0
  76. {nextmv-0.26.3 → nextmv-0.28.0}/tests/test_logger.py +0 -0
  77. {nextmv-0.26.3 → nextmv-0.28.0}/tests/test_model.py +0 -0
  78. {nextmv-0.26.3 → nextmv-0.28.0}/tests/test_options.py +0 -0
  79. {nextmv-0.26.3 → nextmv-0.28.0}/tests/test_version.py +0 -0
@@ -161,3 +161,6 @@ cython_debug/
161
161
 
162
162
  # VSCode
163
163
  .vscode/
164
+
165
+ # Documentation stuff
166
+ site/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nextmv
3
- Version: 0.26.3
3
+ Version: 0.28.0
4
4
  Summary: The all-purpose Python SDK for Nextmv
5
5
  Project-URL: Homepage, https://www.nextmv.io
6
6
  Project-URL: Documentation, https://www.nextmv.io/docs/python-sdks/nextmv/installation
@@ -0,0 +1 @@
1
+ __version__ = "v0.28.0"
@@ -1,5 +1,5 @@
1
1
  """
2
- When working in a notebook environment, we dont really create a `main.py` file
2
+ When working in a notebook environment, we don't really create a `main.py` file
3
3
  with the main entrypoint of the program. Because the logic is mostly encoded
4
4
  inside the `Model` class, we need to create a `main.py` file that we can run in
5
5
  Nextmv Cloud. This file is used as that entrypoint. It is not intended for a
@@ -19,9 +19,7 @@ def main() -> None:
19
19
  manifest = cloud.Manifest.from_yaml(".")
20
20
 
21
21
  # Load the options from the manifest.
22
- options = None
23
- if manifest.options is not None:
24
- options = manifest.extract_options()
22
+ options = manifest.extract_options()
25
23
 
26
24
  # Load the model.
27
25
  loaded_model = load_model(
@@ -29,7 +27,7 @@ def main() -> None:
29
27
  suppress_warnings=True,
30
28
  )
31
29
 
32
- # Load the input and solve the model by using mlflows inference API.
30
+ # Load the input and solve the model by using mlflow's inference API.
33
31
  input = nextmv.load(options=options)
34
32
  output = loaded_model.predict(input)
35
33
 
@@ -1,6 +1,7 @@
1
1
  """Nextmv Python SDK."""
2
2
 
3
3
  from .__about__ import __version__
4
+ from .base_model import BaseModel as BaseModel
4
5
  from .base_model import from_dict as from_dict
5
6
  from .input import Input as Input
6
7
  from .input import InputFormat as InputFormat
@@ -0,0 +1,90 @@
1
+ """
2
+ Provides base functionality for handling JSON data in models.
3
+
4
+ This module contains utilities for converting between dictionaries and model
5
+ instances, facilitating data serialization and deserialization.
6
+
7
+ Classes
8
+ -------
9
+ BaseModel:
10
+ A base class extending Pydantic's BaseModel with additional methods for
11
+ JSON data serialization and deserialization.
12
+
13
+ Functions
14
+ ---------
15
+ from_dict:
16
+ Load a data model instance from a dictionary containing class information
17
+ and attributes.
18
+ """
19
+
20
+ from importlib import import_module
21
+ from typing import Any, Optional
22
+
23
+ from pydantic import BaseModel as PydanticBaseModel
24
+
25
+
26
+ class BaseModel(PydanticBaseModel):
27
+ """
28
+ Base class for data wrangling tasks with JSON.
29
+
30
+ This class extends Pydantic's `BaseModel` to provide additional methods
31
+ for converting between Python objects and JSON/dictionary representations.
32
+ """
33
+
34
+ @classmethod
35
+ def from_dict(cls, data: Optional[dict[str, Any]] = None):
36
+ """
37
+ Instantiate the class from a dictionary.
38
+
39
+ Parameters
40
+ ----------
41
+ data : dict[str, Any], optional
42
+ The dictionary containing the data to instantiate the class.
43
+ If None, returns None.
44
+
45
+ Returns
46
+ -------
47
+ cls or None
48
+ An instance of the class with the given data or None if data is None.
49
+ """
50
+
51
+ if data is None:
52
+ return None
53
+
54
+ return cls(**data)
55
+
56
+ def to_dict(self) -> dict[str, Any]:
57
+ """
58
+ Convert the class instance to a dictionary.
59
+
60
+ The conversion uses Pydantic's model_dump method, excluding None values
61
+ and using field aliases if defined.
62
+
63
+ Returns
64
+ -------
65
+ dict[str, Any]
66
+ Dictionary representation of the class instance.
67
+ """
68
+
69
+ return self.model_dump(mode="json", exclude_none=True, by_alias=True)
70
+
71
+
72
+ def from_dict(data: dict[str, Any]) -> Any:
73
+ """
74
+ Load a data model instance from a `dict` with associated class info.
75
+
76
+ Parameters
77
+ ----------
78
+ data : dict[str, Any]
79
+ The data to load.
80
+
81
+ Returns
82
+ -------
83
+ Any
84
+ The loaded data model instance.
85
+ """
86
+
87
+ module = import_module(data["class"]["module"])
88
+ cls = getattr(module, data["class"]["name"])
89
+
90
+ return cls.from_dict(data["attributes"])
@@ -23,15 +23,18 @@ from .application import Application as Application
23
23
  from .application import DownloadURL as DownloadURL
24
24
  from .application import PollingOptions as PollingOptions
25
25
  from .application import UploadURL as UploadURL
26
+ from .application import poll as poll
26
27
  from .batch_experiment import BatchExperiment as BatchExperiment
27
28
  from .batch_experiment import BatchExperimentInformation as BatchExperimentInformation
28
29
  from .batch_experiment import BatchExperimentMetadata as BatchExperimentMetadata
29
30
  from .batch_experiment import BatchExperimentRun as BatchExperimentRun
30
31
  from .client import Client as Client
32
+ from .client import get_size as get_size
31
33
  from .input_set import InputSet as InputSet
32
34
  from .input_set import ManagedInput as ManagedInput
33
35
  from .instance import Instance as Instance
34
36
  from .instance import InstanceConfiguration as InstanceConfiguration
37
+ from .manifest import MANIFEST_FILE_NAME as MANIFEST_FILE_NAME
35
38
  from .manifest import Manifest as Manifest
36
39
  from .manifest import ManifestBuild as ManifestBuild
37
40
  from .manifest import ManifestOption as ManifestOption