Skip to content

Commit 5376f86

Browse files
Fix docstring typos and old type hints (#226)
1 parent 1f58fd8 commit 5376f86

File tree

8 files changed

+43
-43
lines changed

8 files changed

+43
-43
lines changed

aiida_mlip/calculations/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class BaseJanus(CalcJob): # numpydoc ignore=PR01
9595
-------
9696
define(spec: CalcJobProcessSpec) -> None:
9797
Define the process specification, its inputs, outputs and exit codes.
98-
validate_inputs(value: dict, port_namespace: PortNamespace) -> Optional[str]:
98+
validate_inputs(value: dict, port_namespace: PortNamespace) -> str | None:
9999
Check if the inputs are valid.
100100
prepare_for_submission(folder: Folder) -> CalcInfo:
101101
Create the input files for the `CalcJob`.

aiida_mlip/calculations/singlepoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Singlepoint(BaseJanus): # numpydoc ignore=PR01
2424
-------
2525
define(spec: CalcJobProcessSpec) -> None:
2626
Define the process specification, its inputs, outputs and exit codes.
27-
validate_inputs(value: dict, port_namespace: PortNamespace) -> Optional[str]:
27+
validate_inputs(value: dict, port_namespace: PortNamespace) -> str | None:
2828
Check if the inputs are valid.
2929
prepare_for_submission(folder: Folder) -> CalcInfo:
3030
Create the input files for the `CalcJob`.

aiida_mlip/calculations/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class Train(CalcJob): # numpydoc ignore=PR01
7474
-------
7575
define(spec: CalcJobProcessSpec) -> None:
7676
Define the process specification, its inputs, outputs and exit codes.
77-
validate_inputs(value: dict, port_namespace: PortNamespace) -> Optional[str]:
77+
validate_inputs(value: dict, port_namespace: PortNamespace) -> str | None:
7878
Check if the inputs are valid.
7979
prepare_for_submission(folder: Folder) -> CalcInfo:
8080
Create the input files for the `CalcJob`.

aiida_mlip/data/config.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ class JanusConfigfile(SinglefileData):
1717
1818
Parameters
1919
----------
20-
file : Union[str, Path]
20+
file : str | Path
2121
Absolute path to the file.
22-
filename : Optional[str], optional
23-
Name to be used for the file (defaults to the name of provided file).
22+
filename : str | None
23+
Name to be used for the file. Default is the name of provided file.
2424
2525
Attributes
2626
----------
@@ -51,14 +51,14 @@ def __init__(
5151
**kwargs: Any,
5252
) -> None:
5353
"""
54-
Initialize the ModelData object.
54+
Initialize the JanusConfigfile object.
5555
5656
Parameters
5757
----------
58-
file : Union[str, Path]
58+
file : str | Path
5959
Absolute path to the file.
60-
filename : Optional[str], optional
61-
Name to be used for the file (defaults to the name of provided file).
60+
filename : str | None
61+
Name to be used for the file. Defaults is the name of provided file.
6262
6363
Other Parameters
6464
----------------
@@ -96,10 +96,10 @@ def set_file(
9696
9797
Parameters
9898
----------
99-
file : Union[str, Path]
99+
file : str | Path
100100
Absolute path to the file.
101-
filename : Optional[str], optional
102-
Name to be used for the file (defaults to the name of provided file).
101+
filename : str | None
102+
Name to be used for the file. Default is the name of provided file.
103103
104104
Other Parameters
105105
----------------

aiida_mlip/data/model.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ class ModelData(SinglefileData):
1616
1717
Parameters
1818
----------
19-
file : Union[str, Path]
19+
file : str | Path
2020
Absolute path to the file.
2121
architecture : str
2222
Architecture of the mlip model.
23-
filename : Optional[str], optional
24-
Name to be used for the file (defaults to the name of provided file).
23+
filename : str | None
24+
Name to be used for the file. Default is the name of provided file.
2525
2626
Attributes
2727
----------
@@ -52,7 +52,7 @@ def _calculate_hash(file: str | Path) -> str:
5252
5353
Parameters
5454
----------
55-
file : Union[str, Path]
55+
file : str | Path
5656
Path to the file for which hash needs to be calculated.
5757
5858
Returns
@@ -81,12 +81,12 @@ def __init__(
8181
8282
Parameters
8383
----------
84-
file : Union[str, Path]
84+
file : str | Path
8585
Absolute path to the file.
86-
architecture : [str]
86+
architecture : str
8787
Architecture of the mlip model.
88-
filename : Optional[str], optional
89-
Name to be used for the file (defaults to the name of provided file).
88+
filename : str | None
89+
Name to be used for the file. Default is the name of provided file.
9090
9191
Other Parameters
9292
----------------
@@ -108,12 +108,12 @@ def set_file(
108108
109109
Parameters
110110
----------
111-
file : Union[str, Path]
111+
file : str | Path
112112
Absolute path to the file.
113-
filename : Optional[str], optional
114-
Name to be used for the file (defaults to the name of provided file).
115-
architecture : Optional[str], optional
116-
Architecture of the mlip model.
113+
filename : str | None
114+
Name to be used for the file. Defaults is the name of provided file.
115+
architecture : str | None
116+
Architecture of the mlip model. Default is `None`.
117117
118118
Other Parameters
119119
----------------
@@ -138,12 +138,12 @@ def from_local(
138138
139139
Parameters
140140
----------
141-
file : Union[str, Path]
141+
file : str | Path
142142
Path to the file.
143-
architecture : [str]
143+
architecture : str
144144
Architecture of the mlip model.
145-
filename : Optional[str], optional
146-
Name to be used for the file (defaults to the name of provided file).
145+
filename : str | None
146+
Name to be used for the file. Default is the name of provided file.
147147
148148
Returns
149149
-------
@@ -169,16 +169,16 @@ def from_uri(
169169
----------
170170
uri : str
171171
URI of the file to download.
172-
architecture : [str]
172+
architecture : str
173173
Architecture of the mlip model.
174-
filename : Optional[str], optional
174+
filename : str | None
175175
Name to be used for the file defaults to tmp_file.model.
176-
cache_dir : Optional[Union[str, Path]], optional
177-
Path to the folder where the file has to be saved
178-
(defaults to "~/.cache/mlips/").
179-
keep_file : Optional[bool], optional
176+
cache_dir : str | Path | None
177+
Path to the folder where the file has to be saved. Defaults is
178+
"~/.cache/mlips/".
179+
keep_file : bool | None
180180
True to keep the downloaded model, even if there are duplicates.
181-
(default: False, the file is deleted and only saved in the database).
181+
Default is `False`, so the file is deleted and only saved in the database.
182182
183183
Returns
184184
-------

aiida_mlip/helpers/converters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def xyz_to_aiida_traj(
4040
4141
Parameters
4242
----------
43-
traj_file : Union[str, Path]
43+
traj_file : str | Path
4444
The path to the XYZ file.
4545
4646
Returns

aiida_mlip/helpers/help_load.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ def load_model(
2727
2828
Parameters
2929
----------
30-
model : Optional[Union[str, Path]]
30+
model : str | Path | None
3131
Model file path or a URI for downloading the model or None to use the default.
3232
architecture : str
3333
The architecture of the model.
34-
cache_dir : Optional[Union[str, Path]]
34+
cache_dir : str | Path | None
3535
Directory where to save the dowloaded model.
3636
3737
Returns
@@ -64,7 +64,7 @@ def load_structure(struct: str | Path | int | None = None) -> StructureData:
6464
6565
Parameters
6666
----------
67-
struct : Optional[Union[str, Path, int]]
67+
struct : str | Path | int | None
6868
The input value representing either a path to a structure file, a node PK,
6969
or None.
7070

aiida_mlip/workflows/ht_workgraph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ def build_ht_calc(
3030
3131
Parameters
3232
----------
33-
calc : Union[CalcJob, Callable, WorkChain, WorkGraph]
33+
calc : CalcJob | Callable | WorkChain | WorkGraph
3434
Calculation to be performed on all structures.
35-
folder : Union[Path, str, Str]
35+
folder : Path | str | Str
3636
Path to the folder containing input structure files.
3737
calc_inputs : dict
3838
Dictionary of inputs, shared by all the calculations. Must not contain

0 commit comments

Comments
 (0)