From 0f950d3c07fc32ca075067e4425e036ee67b8567 Mon Sep 17 00:00:00 2001 From: Alin Marin Elena Date: Fri, 13 Sep 2024 12:20:33 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Jacob Wilkins <46597752+oerc0122@users.noreply.github.com> --- janus_core/calculations/phonons.py | 18 +++++++++--------- janus_core/cli/phonons.py | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/janus_core/calculations/phonons.py b/janus_core/calculations/phonons.py index 352c3e3c..ed72fb0e 100644 --- a/janus_core/calculations/phonons.py +++ b/janus_core/calculations/phonons.py @@ -60,7 +60,7 @@ class Phonons(BaseCalculation): Size of supercell for calculation. Default is 2. displacement : float Displacement for force constants calculation, in A. Default is 0.01. - mesh : MaybeSequence[float] + mesh : MaybeSequence[int] Mesh for sampling. Default is (10, 10, 10). symmetrize : bool Whether to symmetrize force constants after calculation. @@ -140,7 +140,7 @@ def __init__( calcs: MaybeSequence[PhononCalcs] = (), supercell: MaybeList[int] = 2, displacement: float = 0.01, - mesh: MaybeSequence[float] = (10, 10, 10), + mesh: MaybeSequence[int] = (10, 10, 10), symmetrize: bool = False, minimize: bool = False, minimize_kwargs: Optional[dict[str, Any]] = None, @@ -189,7 +189,7 @@ def __init__( Size of supercell for calculation. Default is 2. displacement : float Displacement for force constants calculation, in A. Default is 0.01. - mesh : MaybeSequence[float] + mesh : MaybeSequence[int] Mesh for sampling. Default is (10, 10, 10). symmetrize : bool Whether to symmetrize force constants after calculations. @@ -497,7 +497,7 @@ def write_bands( def calc_thermal_props( self, - mesh: Optional[MaybeSequence[float]] = None, + mesh: Optional[MaybeSequence[int]] = None, write_thermal: Optional[bool] = None, **kwargs, ) -> None: @@ -506,7 +506,7 @@ def calc_thermal_props( Parameters ---------- - mesh : Optional[MaybeSequence[float]] + mesh : Optional[MaybeSequence[int]] Mesh for sampling. Default is self.mesh. write_thermal : Optional[bool] Whether to write out thermal properties to file. Default is @@ -577,7 +577,7 @@ def write_thermal_props(self, thermal_file: Optional[PathLike] = None) -> None: def calc_dos( self, *, - mesh: Optional[MaybeSequence[float]] = None, + mesh: Optional[MaybeSequence[int]] = None, write_dos: Optional[bool] = None, **kwargs, ) -> None: @@ -586,7 +586,7 @@ def calc_dos( Parameters ---------- - mesh : Optional[MaybeSequence[float]] + mesh : Optional[MaybeSequence[int]] Mesh for sampling. Default is self.mesh. write_dos : Optional[bool] Whether to write out results to file. Default is True. @@ -682,7 +682,7 @@ def write_dos( def calc_pdos( self, *, - mesh: Optional[MaybeSequence[float]] = None, + mesh: Optional[MaybeSequence[int]] = None, write_pdos: Optional[bool] = None, **kwargs, ) -> None: @@ -691,7 +691,7 @@ def calc_pdos( Parameters ---------- - mesh : Optional[MaybeSequence[float]] + mesh : Optional[MaybeSequence[int]] Mesh for sampling. Default is self.mesh. write_pdos : Optional[bool] Whether to write out results to file. Default is self.write_results. diff --git a/janus_core/cli/phonons.py b/janus_core/cli/phonons.py index c14d87a9..c6fc4d42 100644 --- a/janus_core/cli/phonons.py +++ b/janus_core/cli/phonons.py @@ -46,7 +46,7 @@ def phonons( float, Option(help="Displacement for force constants calculation, in A.") ] = 0.01, mesh: Annotated[ - tuple[float, float, float], Option(help="Mesh numbers along a, b, c axes.") + tuple[int, int, int], Option(help="Mesh numbers along a, b, c axes.") ] = (10, 10, 10), bands: Annotated[ bool, @@ -127,7 +127,7 @@ def phonons( 2x2x2. displacement : float Displacement for force constants calculation, in A. Default is 0.01. - mesh : tuple[float, float, float] + mesh : tuple[int, int, int] Mesh for sampling. Default is (10, 10, 10). bands : bool Whether to calculate and save the band structure. Default is False.