Skip to content

Commit

Permalink
fix missing arguments in doc strings in pymatgen/entries
Browse files Browse the repository at this point in the history
remove unused verbose flag from get_mixing_state_data()
  • Loading branch information
janosh committed Apr 6, 2023
1 parent 1112d6d commit e32b3a2
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ developers:
first_name: Francesco
last_name: Ricci
orcid: 0000-0002-2677-7227
- affiliations: [University of Cambridge]
- affiliations: [University of Cambridge, Lawrence Berkeley National Laboratory]
first_name: Janosh
last_name: Riebesell
orcid: 0000-0001-5233-3462
Expand Down
8 changes: 4 additions & 4 deletions pymatgen/analysis/adsorption.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ def get_extended_surface_mesh(self, repeat=(5, 5, 1)):

@property
def surface_sites(self):
"""convenience method to return a list of surface sites."""
"""Convenience method to return a list of surface sites."""
return [site for site in self.slab.sites if site.properties["surface_properties"] == "surface"]

def subsurface_sites(self):
"""convenience method to return list of subsurface sites."""
"""Convenience method to return list of subsurface sites."""
return [site for site in self.slab.sites if site.properties["surface_properties"] == "subsurface"]

def find_adsorption_sites(
Expand Down Expand Up @@ -607,13 +607,13 @@ def get_rot(slab):


def put_coord_inside(lattice, cart_coordinate):
"""converts a Cartesian coordinate such that it is inside the unit cell."""
"""Converts a Cartesian coordinate such that it is inside the unit cell."""
fc = lattice.get_fractional_coords(cart_coordinate)
return lattice.get_cartesian_coords([c - np.floor(c) for c in fc])


def reorient_z(structure):
"""reorients a structure such that the z axis is concurrent with the normal
"""Reorients a structure such that the z axis is concurrent with the normal
to the A-B plane.
"""
struct = structure.copy()
Expand Down
13 changes: 5 additions & 8 deletions pymatgen/analysis/wulff.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,8 @@ def get_plot(
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d as mpl3

color_list, color_proxy, color_proxy_on_wulff, miller_on_wulff, e_surf_on_wulff = self._get_colors(
color_set, alpha, off_color, custom_colors=custom_colors or {}
)
colors = self._get_colors(color_set, alpha, off_color, custom_colors=custom_colors or {})
color_list, color_proxy, color_proxy_on_wulff, miller_on_wulff, e_surf_on_wulff = colors

if not direction:
# If direction is not specified, use the miller indices of
Expand Down Expand Up @@ -485,11 +484,9 @@ def get_plot(
fancybox=True,
shadow=False,
)
ax.set_xlabel("x")
ax.set_ylabel("y")
ax.set_zlabel("z")
ax.set(xlabel="x", ylabel="y", zlabel="z")

# Add colorbar
# Add color bar
if bar_on:
cmap = plt.get_cmap(color_set)
cmap.set_over("0.25")
Expand All @@ -503,7 +500,7 @@ def get_plot(
ax1,
cmap=cmap,
norm=norm,
boundaries=[0, *bounds] + [10],
boundaries=[0, *bounds, 10],
extend="both",
ticks=bounds[:-1],
spacing="proportional",
Expand Down
12 changes: 7 additions & 5 deletions pymatgen/entries/compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ def process_entry(self, entry: ComputedEntry, **kwargs) -> ComputedEntry | None:
Args:
entry: A ComputedEntry object.
**kwargs: Will be passed to process_entries().
Returns:
An adjusted entry if entry is compatible, else None.
Expand All @@ -564,15 +565,14 @@ def process_entries(
restored by setting entry.energy_adjustments = [].
Args:
entries list[ComputedEntry | ComputedStructureEntry]: A sequence of
entries (AnyComputedEntry | list[AnyComputedEntry]): A sequence of
Computed(Structure)Entry objects.
clean (bool): Whether to remove any previously-applied energy adjustments.
If True, all EnergyAdjustment are removed prior to processing the Entry.
Default is True.
Defaults to True.
verbose (bool): Whether to display progress bar for processing multiple entries.
Default is False.
inplace (bool): Whether to adjust input entries in place.
Default is True.
Defaults to False.
inplace (bool): Whether to adjust input entries in place. Defaults to True.
Returns:
list[AnyComputedEntry]: Adjusted entries. Entries in the original list incompatible with
Expand Down Expand Up @@ -1407,6 +1407,8 @@ def process_entries(
Default is False.
verbose (bool): Whether to display progress bar for processing multiple entries.
Default is False.
inplace (bool): Whether to modify the entries in place. If False, a copy of the
entries is made and processed. Default is True.
Returns:
list[AnyComputedEntry]: Adjusted entries. Entries in the original list incompatible with
Expand Down
9 changes: 6 additions & 3 deletions pymatgen/entries/computed_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,10 @@ def __init__(
gibbs_model ('SISSO'): Model for Gibbs Free energy. "SISSO", the descriptor
created by Bartel et al. (2018) -- see reference in documentation, is
currently the only supported) option.
correction (float): A correction to be applied to the energy. Defaults to 0
composition (Composition): The composition of the entry. Defaults to None.
correction (float): A correction to be applied to the energy. Defaults to 0.
energy_adjustments (list): A list of energy adjustments to be applied to
the energy. Defaults to None.
parameters (dict): An optional dict of parameters associated with
the entry. Defaults to None.
data (dict): An optional dict of any additional data associated
Expand Down Expand Up @@ -910,9 +913,9 @@ def _g_delta_sisso(vol_per_atom, reduced_mass, temp) -> float:
Args:
vol_per_atom (float): volume per atom [Å^3/atom]
reduced_mass (float) - reduced mass as calculated with pair-wise sum formula
reduced_mass (float): as calculated with pair-wise sum formula
[amu]
temp (float) - Temperature [K]
temp (float): Temperature [K]
Returns:
float: G^delta [eV/atom]
Expand Down
4 changes: 2 additions & 2 deletions pymatgen/entries/mixing_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def process_entries(
if mixing_state_data is None:
if verbose:
print(" Generating mixing state data from provided entries.")
mixing_state_data = self.get_mixing_state_data(entries_type_1 + entries_type_2, verbose=False)
mixing_state_data = self.get_mixing_state_data(entries_type_1 + entries_type_2)

if verbose:
# how many stable entries from run_type_1 do we have in run_type_2?
Expand Down Expand Up @@ -458,7 +458,7 @@ def get_adjustments(self, entry, mixing_state_data: pd.DataFrame = None):
f"an edge case in {type(self).__name__}. Inspect your input carefully and post a bug report."
)

def get_mixing_state_data(self, entries: list[ComputedStructureEntry], verbose: bool = False):
def get_mixing_state_data(self, entries: list[ComputedStructureEntry]):
"""
Generate internal state data to be passed to get_adjustments.
Expand Down
4 changes: 2 additions & 2 deletions pymatgen/io/abinit/abiobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def to_abivars(self):
return {"occopt": self.occopt, "tsmear": self.tsmear}

def as_dict(self):
"""json friendly dict representation of Smearing"""
"""JSON-friendly dict representation of Smearing"""
return {
"@module": type(self).__module__,
"@class": type(self).__name__,
Expand Down Expand Up @@ -599,7 +599,7 @@ def nspden(self):
return self.spin_mode.nspden

def as_dict(self):
"""json friendly dict representation"""
"""Json friendly dict representation"""
d = {}
d["@module"] = type(self).__module__
d["@class"] = type(self).__name__
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/io/abinit/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ def on_all(*args, **kwargs):
return on_all

def __add__(self, other):
"""self + other"""
"""Self + other"""
if isinstance(other, BasicAbinitInput):
new_mds = BasicMultiDataset.from_inputs(self)
new_mds.append(other)
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/io/feff/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def charge_transfer_from_file(feff_inp_file, ldos_file):
return cht

def charge_transfer_to_string(self):
"""returns shrage transfer as string"""
"""Returns charge transfer as string"""
ch = self.charge_transfer
chts = ["\nCharge Transfer\n\nabsorbing atom"]
for i in range(len(ch)):
Expand Down
2 changes: 1 addition & 1 deletion pymatgen/io/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ def read_scan(self):
"""

def floatList(lst):
"""return a list of float from a list of string"""
"""Return a list of float from a list of string"""
return [float(val) for val in lst]

scan_patt = re.compile(r"^\sSummary of the potential surface scan:")
Expand Down

0 comments on commit e32b3a2

Please sign in to comment.