Skip to content

Commit

Permalink
Minor fixes to pydantic models (#1884)
Browse files Browse the repository at this point in the history
* Minor fixes encountered recently

* changelog updated

* removed import error suppression from covalent init for qelectrons
  • Loading branch information
kessler-frost authored Dec 11, 2023
1 parent 60b09e1 commit d94bdaf
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
important, whether the size is reported to be zero or positive does
have consequences.
- Pack deps, call_before, and call_after assets into one file.
- `qelectron_db`, `qelectron_data_exists`, `python_version`, and `covalent_version`
are now optional in the pydantic model definitions.

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions covalent/_shared_files/schemas/electron.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ElectronAssets(BaseModel):
error: Optional[AssetSchema] = None
stdout: Optional[AssetSchema] = None
stderr: Optional[AssetSchema] = None
qelectron_db: AssetSchema
qelectron_db: Optional[AssetSchema] = None

# user dependent assets
hooks: AssetSchema
Expand All @@ -97,7 +97,7 @@ class ElectronMetadata(BaseModel):
name: str
executor: str
executor_data: dict
qelectron_data_exists: bool
qelectron_data_exists: Optional[bool] = None
sub_dispatch_id: Optional[str] = None
status: StatusEnum
start_time: Optional[datetime] = None
Expand Down
4 changes: 2 additions & 2 deletions covalent/_shared_files/schemas/lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ class LatticeMetadata(BaseModel):
executor_data: dict
workflow_executor: str
workflow_executor_data: dict
python_version: str
covalent_version: str
python_version: Optional[str] = None
covalent_version: Optional[str] = None


class LatticeSchema(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion covalent/_workflow/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def get_node_value(self, node_key: int, value_key: str) -> Any:
"""
return self._graph.nodes[node_key][value_key]

def set_node_value(self, node_key: int, value_key: int, value: Any) -> None:
def set_node_value(self, node_key: str, value_key: int, value: Any) -> None:
"""
Set a certain value of a node. This allows for saving custom data
in the graph nodes.
Expand Down
1 change: 1 addition & 0 deletions requirements-client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dask[distributed]>=2022.6.0
filelock>=3.12.2
furl>=2.1.3
networkx>=2.8.6
pydantic>=2.1.1
requests>=2.24.0
simplejson>=3.17.6
toml>=0.10.2
Expand Down

0 comments on commit d94bdaf

Please sign in to comment.