nextmv 0.30.0__py3-none-any.whl → 0.31.0__py3-none-any.whl

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.
nextmv/cloud/input_set.py CHANGED
@@ -14,7 +14,7 @@ from datetime import datetime
14
14
  from typing import Optional
15
15
 
16
16
  from nextmv.base_model import BaseModel
17
- from nextmv.cloud.run import Format
17
+ from nextmv.run import Format
18
18
 
19
19
 
20
20
  class ManagedInput(BaseModel):
nextmv/cloud/package.py CHANGED
@@ -10,8 +10,8 @@ import tarfile
10
10
  import tempfile
11
11
  from typing import Optional
12
12
 
13
- from nextmv.cloud.manifest import MANIFEST_FILE_NAME, Manifest, ManifestBuild, ManifestType
14
13
  from nextmv.logger import log
14
+ from nextmv.manifest import MANIFEST_FILE_NAME, Manifest, ManifestBuild, ManifestType
15
15
  from nextmv.model import Model, ModelConfiguration, _cleanup_python_model
16
16
 
17
17
  _MANDATORY_FILES_PER_TYPE = {
nextmv/cloud/url.py ADDED
@@ -0,0 +1,73 @@
1
+ """
2
+ Module for declarations related to upload and download URLs in Nextmv Cloud.
3
+
4
+ Classes
5
+ -------
6
+ DownloadURL
7
+ Represents a download URL for fetching content from Nextmv Cloud.
8
+ UploadURL
9
+ Represents an upload URL for sending content to Nextmv Cloud.
10
+ """
11
+
12
+ from nextmv.base_model import BaseModel
13
+
14
+
15
+ class DownloadURL(BaseModel):
16
+ """
17
+ Result of getting a download URL.
18
+
19
+ You can import the `DownloadURL` class directly from `cloud`:
20
+
21
+ ```python
22
+ from nextmv.cloud import DownloadURL
23
+ ```
24
+
25
+ This class represents a download URL that can be used to fetch content
26
+ from Nextmv Cloud, typically used for downloading large run results.
27
+
28
+ Attributes
29
+ ----------
30
+ url : str
31
+ URL to use for downloading the file.
32
+
33
+ Examples
34
+ --------
35
+ >>> download_url = DownloadURL(url="https://example.com/download")
36
+ >>> response = requests.get(download_url.url)
37
+ """
38
+
39
+ url: str
40
+ """URL to use for downloading the file."""
41
+
42
+
43
+ class UploadURL(BaseModel):
44
+ """
45
+ Result of getting an upload URL.
46
+
47
+ You can import the `UploadURL` class directly from `cloud`:
48
+
49
+ ```python
50
+ from nextmv.cloud import UploadURL
51
+ ```
52
+
53
+ This class represents an upload URL that can be used to send data to
54
+ Nextmv Cloud, typically used for uploading large inputs for runs.
55
+
56
+ Attributes
57
+ ----------
58
+ upload_id : str
59
+ ID of the upload, used to reference the uploaded content.
60
+ upload_url : str
61
+ URL to use for uploading the file.
62
+
63
+ Examples
64
+ --------
65
+ >>> upload_url = UploadURL(upload_id="123", upload_url="https://example.com/upload")
66
+ >>> with open("large_input.json", "rb") as f:
67
+ ... requests.put(upload_url.upload_url, data=f)
68
+ """
69
+
70
+ upload_id: str
71
+ """ID of the upload."""
72
+ upload_url: str
73
+ """URL to use for uploading the file."""
@@ -0,0 +1 @@
1
+ .nextmv
@@ -9,3 +9,5 @@ python:
9
9
  # (e.g.: configs/*.json) is supported.
10
10
  files:
11
11
  - src/
12
+
13
+ entrypoint: src/main.py
@@ -24,7 +24,8 @@ assets = create_visuals(name, input.data["radius"], input.data["distance"])
24
24
 
25
25
  # Write output and statistics.
26
26
  output = nextmv.Output(
27
- solution=None,
27
+ options=options,
28
+ solution={"message": message},
28
29
  statistics=nextmv.Statistics(
29
30
  result=nextmv.ResultStatistics(
30
31
  value=1.23,
nextmv/input.py CHANGED
@@ -20,6 +20,13 @@ Functions
20
20
  ---------
21
21
  load
22
22
  Load input data using a specified loader.
23
+
24
+ Constants
25
+ ---------
26
+ INPUTS_KEY : str
27
+ Key used for identifying inputs in the run.
28
+ DEFAULT_INPUT_JSON_FILE : str
29
+ Constant for the default input JSON file name.
23
30
  """
24
31
 
25
32
  import copy
@@ -36,6 +43,15 @@ from nextmv._serialization import serialize_json
36
43
  from nextmv.deprecated import deprecated
37
44
  from nextmv.options import Options
38
45
 
46
+ INPUTS_KEY = "inputs"
47
+ """
48
+ Inputs key constant used for identifying inputs in the run.
49
+ """
50
+ DEFAULT_INPUT_JSON_FILE = "input.json"
51
+ """
52
+ Constant for the default input JSON file name.
53
+ """
54
+
39
55
 
40
56
  class InputFormat(str, Enum):
41
57
  """
@@ -911,7 +927,7 @@ class LocalInputLoader(InputLoader):
911
927
  If the path is not a directory or the default directory doesn't exist.
912
928
  """
913
929
 
914
- dir_path = "inputs"
930
+ dir_path = INPUTS_KEY
915
931
  if path is not None and path != "":
916
932
  if not os.path.isdir(path):
917
933
  raise ValueError(f"path {path} is not a directory")
@@ -0,0 +1,5 @@
1
+ """
2
+ Functionality for locally simulating the Nextmv Cloud.
3
+ """
4
+
5
+ from .application import Application as Application