Skip to content

Commit

Permalink
Update docstrings (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar authored Nov 8, 2024
1 parent ae46a4e commit 014c988
Show file tree
Hide file tree
Showing 14 changed files with 248 additions and 248 deletions.
46 changes: 23 additions & 23 deletions janus_core/calculations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,46 +26,46 @@ class BaseCalculation(FileNameMixin):
----------
calc_name : str
Name of calculation being run, used for name of logger. Default is "base".
struct : Optional[MaybeSequence[Atoms]]
struct : MaybeSequence[Atoms] | None
ASE Atoms structure(s) to simulate. Required if `struct_path` is None.
Default is None.
struct_path : Optional[PathLike]
struct_path : PathLike | None
Path of structure to simulate. Required if `struct` is None.
Default is None.
arch : Architectures
MLIP architecture to use for calculations. Default is "mace_mp".
device : Devices
Device to run model on. Default is "cpu".
model_path : Optional[PathLike]
model_path : PathLike | None
Path to MLIP model. Default is `None`.
read_kwargs : ASEReadArgs
Keyword arguments to pass to ase.io.read. Default is {}.
sequence_allowed : bool
Whether a sequence of Atoms objects is allowed. Default is True.
calc_kwargs : Optional[dict[str, Any]]
calc_kwargs : dict[str, Any] | None
Keyword arguments to pass to the selected calculator. Default is {}.
set_calc : Optional[bool]
set_calc : bool | None
Whether to set (new) calculators for structures. Default is None.
attach_logger : bool
Whether to attach a logger. Default is False.
log_kwargs : Optional[dict[str, Any]]
log_kwargs : dict[str, Any] | None
Keyword arguments to pass to `config_logger`. Default is {}.
track_carbon : bool
Whether to track carbon emissions of calculation. Default is True.
tracker_kwargs : Optional[dict[str, Any]]
tracker_kwargs : dict[str, Any] | None
Keyword arguments to pass to `config_tracker`. Default is {}.
file_prefix : Optional[PathLike]
file_prefix : PathLike | None
Prefix for output filenames. Default is None.
additional_prefix : Optional[str]
additional_prefix : str | None
Component to add to default file_prefix (joined by hyphens). Default is None.
param_prefix : Optional[str]
param_prefix : str | None
Additional parameters to add to default file_prefix. Default is None.
Attributes
----------
logger : Optional[logging.Logger]
logger : logging.Logger | None
Logger if log file has been specified.
tracker : Optional[OfflineEmissionsTracker]
tracker : OfflineEmissionsTracker | None
Tracker if logging is enabled.
"""

Expand Down Expand Up @@ -97,40 +97,40 @@ def __init__(
----------
calc_name : str
Name of calculation being run, used for name of logger. Default is "base".
struct : Optional[MaybeSequence[Atoms]]
struct : MaybeSequence[Atoms] | None
ASE Atoms structure(s) to simulate. Required if `struct_path` is None.
Default is None.
struct_path : Optional[PathLike]
struct_path : PathLike | None
Path of structure to simulate. Required if `struct` is None. Default is
None.
arch : Architectures
MLIP architecture to use for calculations. Default is "mace_mp".
device : Devices
Device to run MLIP model on. Default is "cpu".
model_path : Optional[PathLike]
model_path : PathLike | None
Path to MLIP model. Default is `None`.
read_kwargs : Optional[ASEReadArgs]
read_kwargs : ASEReadArgs | None
Keyword arguments to pass to ase.io.read. Default is {}.
sequence_allowed : bool
Whether a sequence of Atoms objects is allowed. Default is True.
calc_kwargs : Optional[dict[str, Any]]
calc_kwargs : dict[str, Any] | None
Keyword arguments to pass to the selected calculator. Default is {}.
set_calc : Optional[bool]
set_calc : bool | None
Whether to set (new) calculators for structures. Default is None.
attach_logger : bool
Whether to attach a logger. Default is False.
log_kwargs : Optional[dict[str, Any]]
log_kwargs : dict[str, Any] | None
Keyword arguments to pass to `config_logger`. Default is {}.
track_carbon : bool
Whether to track carbon emissions of calculation. Default is True.
tracker_kwargs : Optional[dict[str, Any]]
tracker_kwargs : dict[str, Any] | None
Keyword arguments to pass to `config_tracker`. Default is {}.
file_prefix : Optional[PathLike]
file_prefix : PathLike | None
Prefix for output filenames. Default is None.
additional_prefix : Optional[str]
additional_prefix : str | None
Component to add to default file_prefix (joined by hyphens). Default is
None.
param_prefix : Optional[str]
param_prefix : str | None
Additional parameters to add to default file_prefix. Default is None.
"""
(read_kwargs, calc_kwargs, log_kwargs, tracker_kwargs) = none_to_dict(
Expand Down
36 changes: 18 additions & 18 deletions janus_core/calculations/descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,32 @@ class Descriptors(BaseCalculation):
Parameters
----------
struct : Optional[MaybeSequence[Atoms]]
struct : MaybeSequence[Atoms] | None
ASE Atoms structure(s) to calculate descriptors for. Required if `struct_path`
is None. Default is None.
struct_path : Optional[PathLike]
struct_path : PathLike | None
Path of structure to calculate descriptors for. Required if `struct` is None.
Default is None.
arch : Architectures
MLIP architecture to use for calculations. Default is "mace_mp".
device : Devices
Device to run MLIP model on. Default is "cpu".
model_path : Optional[PathLike]
model_path : PathLike | None
Path to MLIP model. Default is `None`.
read_kwargs : Optional[ASEReadArgs]
read_kwargs : ASEReadArgs | None
Keyword arguments to pass to ase.io.read. By default,
read_kwargs["index"] is -1.
calc_kwargs : Optional[dict[str, Any]]
calc_kwargs : dict[str, Any] | None
Keyword arguments to pass to the selected calculator. Default is {}.
set_calc : Optional[bool]
set_calc : bool | None
Whether to set (new) calculators for structures. Default is None.
attach_logger : bool
Whether to attach a logger. Default is False.
log_kwargs : Optional[dict[str, Any]]
log_kwargs : dict[str, Any] | None
Keyword arguments to pass to `config_logger`. Default is {}.
track_carbon : bool
Whether to track carbon emissions of calculation. Default is True.
tracker_kwargs : Optional[dict[str, Any]]
tracker_kwargs : dict[str, Any] | None
Keyword arguments to pass to `config_tracker`. Default is {}.
invariants_only : bool
Whether only the invariant descriptors should be returned. Default is True.
Expand All @@ -63,7 +63,7 @@ class Descriptors(BaseCalculation):
Whether to calculate descriptors for each atom. Default is False.
write_results : bool
True to write out structure with results of calculations. Default is False.
write_kwargs : Optional[ASEWriteArgs],
write_kwargs : ASEWriteArgs | None
Keyword arguments to pass to ase.io.write if saving structure with
results of calculations. Default is {}.
Expand Down Expand Up @@ -98,32 +98,32 @@ def __init__(
Parameters
----------
struct : Optional[MaybeSequence[Atoms]]
struct : MaybeSequence[Atoms] | None
ASE Atoms structure(s) to calculate descriptors for. Required if
`struct_path` is None. Default is None.
struct_path : Optional[PathLike]
struct_path : PathLike | None
Path of structure to calculate descriptors for. Required if `struct` is
None. Default is None.
arch : Architectures
MLIP architecture to use for calculations. Default is "mace_mp".
device : Devices
Device to run MLIP model on. Default is "cpu".
model_path : Optional[PathLike]
model_path : PathLike | None
Path to MLIP model. Default is `None`.
read_kwargs : Optional[ASEReadArgs]
read_kwargs : ASEReadArgs | None
Keyword arguments to pass to ase.io.read. By default,
read_kwargs["index"] is -1.
calc_kwargs : Optional[dict[str, Any]]
calc_kwargs : dict[str, Any] | None
Keyword arguments to pass to the selected calculator. Default is {}.
set_calc : Optional[bool]
set_calc : bool | None
Whether to set (new) calculators for structures. Default is None.
attach_logger : bool
Whether to attach a logger. Default is False.
log_kwargs : Optional[dict[str, Any]]
log_kwargs : dict[str, Any] | None
Keyword arguments to pass to `config_logger`. Default is {}.
track_carbon : bool
Whether to track carbon emissions of calculation. Default is True.
tracker_kwargs : Optional[dict[str, Any]]
tracker_kwargs : dict[str, Any] | None
Keyword arguments to pass to `config_tracker`. Default is {}.
invariants_only : bool
Whether only the invariant descriptors should be returned. Default is True.
Expand All @@ -133,7 +133,7 @@ def __init__(
Whether to calculate descriptors for each atom. Default is False.
write_results : bool
True to write out structure with results of calculations. Default is False.
write_kwargs : Optional[ASEWriteArgs],
write_kwargs : ASEWriteArgs | None
Keyword arguments to pass to ase.io.write if saving structure with
results of calculations. Default is {}.
"""
Expand Down
48 changes: 24 additions & 24 deletions janus_core/calculations/eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,32 @@ class EoS(BaseCalculation):
Parameters
----------
struct : Optional[Atoms]
struct : Atoms | None
ASE Atoms structure to calculate equation of state for. Required if
`struct_path` is None. Default is None.
struct_path : Optional[PathLike]
struct_path : PathLike | None
Path of structure to calculate equation of state for. Required if `struct` is
None. Default is None.
arch : Architectures
MLIP architecture to use for calculations. Default is "mace_mp".
device : Devices
Device to run MLIP model on. Default is "cpu".
model_path : Optional[PathLike]
model_path : PathLike | None
Path to MLIP model. Default is `None`.
read_kwargs : Optional[ASEReadArgs]
read_kwargs : ASEReadArgs | None
Keyword arguments to pass to ase.io.read. By default,
read_kwargs["index"] is -1.
calc_kwargs : Optional[dict[str, Any]]
calc_kwargs : dict[str, Any] | None
Keyword arguments to pass to the selected calculator. Default is {}.
set_calc : Optional[bool]
set_calc : bool | None
Whether to set (new) calculators for structures. Default is None.
attach_logger : bool
Whether to attach a logger. Default is False.
log_kwargs : Optional[dict[str, Any]]
log_kwargs : dict[str, Any] | None
Keyword arguments to pass to `config_logger`. Default is {}.
track_carbon : bool
Whether to track carbon emissions of calculation. Default is True.
tracker_kwargs : Optional[dict[str, Any]]
tracker_kwargs : dict[str, Any] | None
Keyword arguments to pass to `config_tracker`. Default is {}.
min_volume : float
Minimum volume scale factor. Default is 0.95.
Expand All @@ -70,20 +70,20 @@ class EoS(BaseCalculation):
Whether to minimize initial structure before calculations. Default is True.
minimize_all : bool
Whether to optimize geometry for all generated structures. Default is False.
minimize_kwargs : Optional[dict[str, Any]]
minimize_kwargs : dict[str, Any] | None
Keyword arguments to pass to optimize. Default is None.
write_results : bool
True to write out results of equation of state calculations. Default is True.
write_structures : bool
True to write out all genereated structures. Default is False.
write_kwargs : Optional[OutputKwargs],
write_kwargs : OutputKwargs | None
Keyword arguments to pass to ase.io.write to save generated structures.
Default is {}.
plot_to_file : bool
Whether to save plot equation of state to svg. Default is False.
plot_kwargs : Optional[dict[str, Any]]
plot_kwargs : dict[str, Any] | None
Keyword arguments to pass to EquationOfState.plot. Default is {}.
file_prefix : Optional[PathLike]
file_prefix : PathLike | None
Prefix for output filenames. Default is inferred from structure name, or
chemical formula of the structure.
Expand Down Expand Up @@ -138,32 +138,32 @@ def __init__(
Parameters
----------
struct : Optional[Atoms]
struct : Atoms | None
ASE Atoms structure to optimize geometry for. Required if `struct_path` is
None. Default is None.
struct_path : Optional[PathLike]
struct_path : PathLike | None
Path of structure to optimize. Required if `struct` is None. Default is
None.
arch : Architectures
MLIP architecture to use for optimization. Default is "mace_mp".
device : Devices
Device to run MLIP model on. Default is "cpu".
model_path : Optional[PathLike]
model_path : PathLike | None
Path to MLIP model. Default is `None`.
read_kwargs : Optional[ASEReadArgs]
read_kwargs : ASEReadArgs | None
Keyword arguments to pass to ase.io.read. By default,
read_kwargs["index"] is -1.
calc_kwargs : Optional[dict[str, Any]]
calc_kwargs : dict[str, Any] | None
Keyword arguments to pass to the selected calculator. Default is {}.
set_calc : Optional[bool]
set_calc : bool | None
Whether to set (new) calculators for structures. Default is None.
attach_logger : bool
Whether to attach a logger. Default is False.
log_kwargs : Optional[dict[str, Any]]
log_kwargs : dict[str, Any] | None
Keyword arguments to pass to `config_logger`. Default is {}.
track_carbon : bool
Whether to track carbon emissions of calculation. Default is True.
tracker_kwargs : Optional[dict[str, Any]]
tracker_kwargs : dict[str, Any] | None
Keyword arguments to pass to `config_tracker`. Default is {}.
min_volume : float
Minimum volume scale factor. Default is 0.95.
Expand All @@ -178,21 +178,21 @@ def __init__(
minimize_all : bool
Whether to optimize geometry for all generated structures. Default is
False.
minimize_kwargs : Optional[dict[str, Any]]
minimize_kwargs : dict[str, Any] | None
Keyword arguments to pass to optimize. Default is None.
write_results : bool
True to write out results of equation of state calculations. Default is
True.
write_structures : bool
True to write out all genereated structures. Default is False.
write_kwargs : Optional[OutputKwargs],
write_kwargs : OutputKwargs | None
Keyword arguments to pass to ase.io.write to save generated structures.
Default is {}.
plot_to_file : bool
Whether to save plot equation of state to svg. Default is False.
plot_kwargs : Optional[dict[str, Any]]
plot_kwargs : dict[str, Any] | None
Keyword arguments to pass to EquationOfState.plot. Default is {}.
file_prefix : Optional[PathLike]
file_prefix : PathLike | None
Prefix for output filenames. Default is inferred from structure name, or
chemical formula of the structure.
"""
Expand Down
Loading

0 comments on commit 014c988

Please sign in to comment.