oceanprotocol-job-details 0.2.2__py3-none-any.whl → 0.2.4__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.
- oceanprotocol_job_details/di.py +4 -1
- oceanprotocol_job_details/ocean.py +4 -0
- oceanprotocol_job_details/paths.py +26 -16
- {oceanprotocol_job_details-0.2.2.dist-info → oceanprotocol_job_details-0.2.4.dist-info}/METADATA +1 -1
- {oceanprotocol_job_details-0.2.2.dist-info → oceanprotocol_job_details-0.2.4.dist-info}/RECORD +7 -7
- {oceanprotocol_job_details-0.2.2.dist-info → oceanprotocol_job_details-0.2.4.dist-info}/WHEEL +0 -0
- {oceanprotocol_job_details-0.2.2.dist-info → oceanprotocol_job_details-0.2.4.dist-info}/licenses/LICENSE +0 -0
oceanprotocol_job_details/di.py
CHANGED
|
@@ -10,7 +10,10 @@ class Container(containers.DeclarativeContainer):
|
|
|
10
10
|
|
|
11
11
|
config = providers.Configuration()
|
|
12
12
|
|
|
13
|
-
paths = providers.Singleton(
|
|
13
|
+
paths = providers.Singleton(
|
|
14
|
+
Paths,
|
|
15
|
+
base_dir=config.base_dir,
|
|
16
|
+
)
|
|
14
17
|
|
|
15
18
|
file_loader = providers.Factory(
|
|
16
19
|
FilesLoader,
|
|
@@ -267,6 +267,8 @@ class JobDetails(Generic[T]):
|
|
|
267
267
|
def load(
|
|
268
268
|
cls,
|
|
269
269
|
_type: Type[T] | None = None,
|
|
270
|
+
*,
|
|
271
|
+
base_dir: str | None = None,
|
|
270
272
|
dids: str | None = None,
|
|
271
273
|
transformation_did: str | None = None,
|
|
272
274
|
secret: str | None = None,
|
|
@@ -278,6 +280,7 @@ class JobDetails(Generic[T]):
|
|
|
278
280
|
1. That the ocean protocol contains the needed data based on the passed environment variables.
|
|
279
281
|
|
|
280
282
|
Those needed environment variables are:
|
|
283
|
+
- BASE_DIR: Base directory to read the data from, parent of the ddos, inputs, outputs and logs directories.
|
|
281
284
|
- DIDS: The DIDs of the inputs
|
|
282
285
|
- TRANSFORMATION_DID: The DID of the transformation algorithm
|
|
283
286
|
- SECRET (optional): A really secret secret
|
|
@@ -290,6 +293,7 @@ class JobDetails(Generic[T]):
|
|
|
290
293
|
container = Container()
|
|
291
294
|
container.config.from_dict(
|
|
292
295
|
{
|
|
296
|
+
"base_dir": base_dir or os.environ.get("BASE_DIR", None),
|
|
293
297
|
"dids": dids or os.environ.get("DIDS"),
|
|
294
298
|
"transformation_did": transformation_did
|
|
295
299
|
or os.environ.get("TRANSFORMATION_DID"),
|
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
from logging import getLogger
|
|
1
|
+
from dataclasses import InitVar, dataclass, field
|
|
3
2
|
from pathlib import Path
|
|
4
3
|
|
|
5
|
-
logger = getLogger(__name__)
|
|
6
|
-
|
|
7
4
|
|
|
8
5
|
@dataclass
|
|
9
6
|
class Paths:
|
|
10
7
|
"""Configuration class for the Ocean Protocol Job Details"""
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
base_dir: InitVar[Path | None]
|
|
10
|
+
|
|
11
|
+
_base: Path = field(init=False)
|
|
12
|
+
|
|
13
|
+
def __post_init__(self, base_dir: Path | None) -> None:
|
|
14
|
+
self._base = base_dir or Path("/data")
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def data(self) -> Path:
|
|
18
|
+
return self._base
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
@property
|
|
21
|
+
def inputs(self) -> Path:
|
|
22
|
+
return self.data / "inputs"
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
@property
|
|
25
|
+
def ddos(self) -> Path:
|
|
26
|
+
return self.data / "ddos"
|
|
20
27
|
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
@property
|
|
29
|
+
def outputs(self) -> Path:
|
|
30
|
+
return self.data / "outputs"
|
|
23
31
|
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
@property
|
|
33
|
+
def logs(self) -> Path:
|
|
34
|
+
return self.data / "logs"
|
|
26
35
|
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
@property
|
|
37
|
+
def algorithm_custom_parameters(self) -> Path:
|
|
38
|
+
return self.inputs / "algoCustomData.json"
|
{oceanprotocol_job_details-0.2.2.dist-info → oceanprotocol_job_details-0.2.4.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oceanprotocol-job-details
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: A Python package to get details from OceanProtocol jobs
|
|
5
5
|
Project-URL: Homepage, https://github.com/AgrospAI/oceanprotocol-job-details
|
|
6
6
|
Project-URL: Issues, https://github.com/AgrospAI/oceanprotocol-job-details/issues
|
{oceanprotocol_job_details-0.2.2.dist-info → oceanprotocol_job_details-0.2.4.dist-info}/RECORD
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
oceanprotocol_job_details/__init__.py,sha256=C67wv7fy5ZT5FtbGD-oQeSoLU-x6e2ts-820koFo034,55
|
|
2
|
-
oceanprotocol_job_details/di.py,sha256=
|
|
3
|
-
oceanprotocol_job_details/ocean.py,sha256
|
|
4
|
-
oceanprotocol_job_details/paths.py,sha256=
|
|
2
|
+
oceanprotocol_job_details/di.py,sha256=j2BvpaGpiQwt9MSiViYPFup4MnzTHm44Zq12_TQ07kY,1180
|
|
3
|
+
oceanprotocol_job_details/ocean.py,sha256=-LdztJ2h1WS9OVWVzc8jAfLcxhzJ9Zqsn8Rk0d7SZOo,7118
|
|
4
|
+
oceanprotocol_job_details/paths.py,sha256=N90IF8OQCBELULGPaBv9yALApa-lC2dsVKXMWLdqa14,851
|
|
5
5
|
oceanprotocol_job_details/loaders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
oceanprotocol_job_details/loaders/loader.py,sha256=HIzsVKCuGP7ghfM7ppN3ANVybvsA64wr3h8I68mqS6A,195
|
|
7
7
|
oceanprotocol_job_details/loaders/impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
oceanprotocol_job_details/loaders/impl/ddo.py,sha256=_xl0PozuvIm0n6jU--Znk6qfw1A6OLBq3SERbDGIF74,844
|
|
9
9
|
oceanprotocol_job_details/loaders/impl/files.py,sha256=oFkA_0Ma5NBgWvVEk_rhyDIDrAam_zjesh0-bxZaIU8,1443
|
|
10
10
|
oceanprotocol_job_details/loaders/impl/job_details.py,sha256=wf0xNAG4tESq57vqkdtMQ8BdiyS91j5f7FL8Gfwbjh4,770
|
|
11
|
-
oceanprotocol_job_details-0.2.
|
|
12
|
-
oceanprotocol_job_details-0.2.
|
|
13
|
-
oceanprotocol_job_details-0.2.
|
|
14
|
-
oceanprotocol_job_details-0.2.
|
|
11
|
+
oceanprotocol_job_details-0.2.4.dist-info/METADATA,sha256=_NdQh6JKQb8debVX1HA_Damd91vuXSOLdazsxqqVsGM,2948
|
|
12
|
+
oceanprotocol_job_details-0.2.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
13
|
+
oceanprotocol_job_details-0.2.4.dist-info/licenses/LICENSE,sha256=ni3ix7P_GxK1W3VGC4fJ3o6QoCngCEpSuTJwO4nkpbw,1055
|
|
14
|
+
oceanprotocol_job_details-0.2.4.dist-info/RECORD,,
|
{oceanprotocol_job_details-0.2.2.dist-info → oceanprotocol_job_details-0.2.4.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|