oceanprotocol-job-details 0.3.2__tar.gz → 0.3.3__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.
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/PKG-INFO +1 -1
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/oceanprotocol_job_details/loaders/impl/files.py +2 -6
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/oceanprotocol_job_details/settings.py +9 -3
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/pyproject.toml +1 -1
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/.gitignore +0 -0
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/LICENSE +0 -0
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/README.md +0 -0
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/oceanprotocol_job_details/__init__.py +0 -0
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/oceanprotocol_job_details/di.py +0 -0
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/oceanprotocol_job_details/domain.py +0 -0
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/oceanprotocol_job_details/helpers.py +0 -0
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/oceanprotocol_job_details/loaders/__init__.py +0 -0
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/oceanprotocol_job_details/loaders/impl/__init__.py +0 -0
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/oceanprotocol_job_details/loaders/impl/ddo.py +0 -0
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/oceanprotocol_job_details/loaders/impl/job_details.py +0 -0
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/oceanprotocol_job_details/loaders/loader.py +0 -0
- {oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/oceanprotocol_job_details/ocean.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oceanprotocol-job-details
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
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
|
|
@@ -20,14 +20,10 @@ class FilesLoader:
|
|
|
20
20
|
dids: list[str]
|
|
21
21
|
"""Input DIDs"""
|
|
22
22
|
|
|
23
|
-
transformation_did:
|
|
23
|
+
transformation_did: str
|
|
24
24
|
"""DID for the transformation algorithm"""
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def __post_init__(self, transformation_did: str | None) -> None:
|
|
29
|
-
object.__setattr__(self, "_transformation_did", transformation_did)
|
|
30
|
-
|
|
26
|
+
def __post_init__(self) -> None:
|
|
31
27
|
assert self.dids, "Missing input DIDs"
|
|
32
28
|
|
|
33
29
|
def calculate_path(self, did: str, path_type: Literal["input", "ddo"]) -> Path:
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
# mypy: disable-error-code=call-overload
|
|
2
2
|
from logging import Logger, getLogger
|
|
3
3
|
from pathlib import Path
|
|
4
|
+
from typing import Self
|
|
4
5
|
|
|
5
6
|
import orjson
|
|
6
|
-
from pydantic import Field, field_validator
|
|
7
|
+
from pydantic import Field, field_validator, model_validator
|
|
7
8
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class JobSettings(BaseSettings): # type: ignore[explicit-any]
|
|
11
12
|
base_dir: Path = Field(alias="BASE_DIR")
|
|
12
|
-
dids: list[str] = Field(alias="DIDS")
|
|
13
|
+
dids: list[str] = Field(default_factory=list, alias="DIDS")
|
|
13
14
|
transformation_did: str = Field(alias="TRANSFORMATION_DID")
|
|
14
15
|
secret: str | None = Field(default=None, alias="SECRET")
|
|
15
16
|
logger: Logger = Field(default_factory=lambda: getLogger(__name__))
|
|
16
17
|
|
|
17
18
|
model_config = SettingsConfigDict(
|
|
18
19
|
extra="forbid",
|
|
19
|
-
validate_default=True,
|
|
20
20
|
populate_by_name=True,
|
|
21
21
|
arbitrary_types_allowed=True,
|
|
22
22
|
)
|
|
@@ -29,3 +29,9 @@ class JobSettings(BaseSettings): # type: ignore[explicit-any]
|
|
|
29
29
|
assert isinstance(data, list)
|
|
30
30
|
return data
|
|
31
31
|
return v
|
|
32
|
+
|
|
33
|
+
@model_validator(mode="after")
|
|
34
|
+
def validate_dids(self) -> Self:
|
|
35
|
+
if not self.dids:
|
|
36
|
+
self.dids.extend([f.name for f in (self.base_dir / "ddos").glob("*")])
|
|
37
|
+
return self
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{oceanprotocol_job_details-0.3.2 → oceanprotocol_job_details-0.3.3}/oceanprotocol_job_details/di.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|