Skip to content

Commit 24e15e4

Browse files
committed
docs
1 parent 03dc518 commit 24e15e4

File tree

5 files changed

+32
-33
lines changed

5 files changed

+32
-33
lines changed

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ select = [
7676
# "ERA001",
7777
"RUF",
7878
"D409",
79-
"D416",
8079
"TCH",
8180
"TID251",
8281
"T20",
@@ -98,7 +97,7 @@ skip-magic-trailing-comma = false
9897
line-ending = "auto"
9998

10099
[tool.ruff.lint.pydocstyle]
101-
convention = "google"
100+
convention = "numpy"
102101

103102
[tool.mypy]
104103
ignore_missing_imports = true

src/pyrho/charge_density.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ChargeDensity(MSONable):
3030
3131
Defines a charge density with a PGrid object along with the atomic structure.
3232
33-
Attributes:
33+
Attributes
3434
----------
3535
pgrids: Dict[str, PGrid]
3636
Dictionaries whose values are periodic ``PGrid`` objects
@@ -67,7 +67,7 @@ def normalized_data(self) -> dict[str, npt.NDArray]:
6767
Since different codes use different normalization methods for
6868
volumetric data we should convert them to the same units (electrons / Angstrom^3)
6969
70-
Returns:
70+
Returns
7171
-------
7272
dict[str, NDArray]:
7373
The normalized data in units of (electrons / Angstrom^3)
@@ -94,7 +94,7 @@ def normalized_pgrids(self) -> dict[str, PGrid]:
9494
Since different codes use different normalization methods for
9595
volumetric data we should convert them to the same units (electrons / Angstrom^3)
9696
97-
Returns:
97+
Returns
9898
-------
9999
dict[str, PGrid]:
100100
The normalized pgrids in units of (electrons / Angstrom^3)
@@ -134,7 +134,7 @@ def from_pmg(
134134
- 'vasp' sum of the data / number of grid points == number of electrons
135135
- None/"none" no normalization
136136
137-
Returns:
137+
Returns
138138
-------
139139
ChargeDensity:
140140
The charge density object
@@ -173,7 +173,7 @@ def get_data_in_cube(self, s: float, ngrid: int, key: str = "total") -> npt.NDAr
173173
key:
174174
The key to read from ``self.normalized_data``
175175
176-
Returns:
176+
Returns
177177
-------
178178
NDArray:
179179
Regridded data in a ngrid x ngrid x ngrid array
@@ -205,7 +205,7 @@ def get_transformed(
205205
up_sample:
206206
The factor to scale up the sampling of the grid data using Fourier interpolation
207207
208-
Returns:
208+
Returns
209209
-------
210210
ChargeDensity:
211211
The transformed ChargeDensity object
@@ -256,7 +256,7 @@ def to_Chgcar(self) -> Chgcar:
256256
257257
Scale and convert each key in the pgrids dictionary and create a ``Chgcar`` object
258258
259-
Returns:
259+
Returns
260260
-------
261261
Chgcar:
262262
The charge density object
@@ -271,7 +271,7 @@ def to_VolumetricData(
271271
272272
Scale and convert each key in the pgrids dictionary and create a ``VolumetricData`` object
273273
274-
Returns:
274+
Returns
275275
-------
276276
VolumetricData:
277277
The charge density object
@@ -299,7 +299,7 @@ def from_file(
299299
The pymatgen object to read from the file (default: Chgcar).
300300
the `from_file` method from this class will be called to read the file.
301301
302-
Returns:
302+
Returns
303303
-------
304304
ChargeDensity: The ChargeDensity object
305305
@@ -320,7 +320,7 @@ def from_hdf5(
320320
The pymatgen object to read from the file (default: Chgcar).
321321
the `from_file` method from this class will be called to read the file.
322322
323-
Returns:
323+
Returns
324324
-------
325325
ChargeDensity: The ChargeDensity object
326326
@@ -342,7 +342,7 @@ def get_matched_structure_mapping(
342342
sc_struct: bigger cell
343343
sm: StructureMatcher instance
344344
345-
Returns:
345+
Returns
346346
-------
347347
sc_m : supercell matrix to apply to s1 to get s2
348348
total_t : translation to apply on s1 * sc_m to get s2
@@ -372,7 +372,7 @@ def get_volumetric_like_sc(
372372
):
373373
"""Get the volumetric data in the supercell.
374374
375-
Parameters:
375+
Parameters
376376
----------
377377
vd: VolumeData instance
378378
sc_struct: supercell structure.
@@ -384,7 +384,7 @@ def get_volumetric_like_sc(
384384
same as VASP's CHGCAR file. If None, no normalization is
385385
done.
386386
387-
Returns:
387+
Returns
388388
-------
389389
VolumetricData: volumetric data in the supercell
390390
"""
@@ -422,7 +422,7 @@ def multiply_aug(data_aug: list[str], factor: int) -> list[str]:
422422
factor:
423423
The multiplication factor (some integer number of times it gets repeated)
424424
425-
Returns:
425+
Returns
426426
-------
427427
List[str]:
428428
Each line of the augmentation data.
@@ -477,7 +477,7 @@ def _normalize_data(
477477
where the second `/vol` account for the different number of electrons in
478478
different cells
479479
480-
Returns:
480+
Returns
481481
-------
482482
NDArray:
483483
The normalized grid data
@@ -505,7 +505,7 @@ def _scaled_data(
505505
normalization:
506506
The normalization method defaults to vasp
507507
508-
Returns:
508+
Returns
509509
-------
510510
NDArray:
511511
The un-normalized grid data

src/pyrho/pgrid.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class PGrid(MSONable):
2424
def __init__(self, grid_data: npt.NDArray, lattice: npt.NDArray):
2525
"""Initialize the PGrid object.
2626
27-
Attributes:
27+
Attributes
2828
----------
2929
grid_data:
3030
Data stored on the regular rid
@@ -61,7 +61,7 @@ def _transform_data(
6161
up_sample:
6262
The factor to scale up the sampling of the grid data using Fourier interpolation
6363
64-
Returns:
64+
Returns
6565
-------
6666
NDArray:
6767
The transformed data
@@ -89,7 +89,7 @@ def __mul__(self, factor: float) -> PGrid:
8989
factor:
9090
The factor to multiply the grid data by
9191
92-
Returns:
92+
Returns
9393
-------
9494
PGrid:
9595
The new PGrid object
@@ -105,7 +105,7 @@ def __truediv__(self, factor: float) -> PGrid:
105105
factor:
106106
The factor to divide the grid data by
107107
108-
Returns:
108+
Returns
109109
-------
110110
PGrid:
111111
The new PGrid object
@@ -133,7 +133,7 @@ def get_transformed(
133133
up_sample:
134134
The factor to scale up the sampling of the grid data using Fourier interpolation
135135
136-
Returns:
136+
Returns
137137
-------
138138
PGrid:
139139
The transformed PGrid object
@@ -161,7 +161,7 @@ def lossy_smooth_compression(
161161
smear_std:
162162
standard deviation of the Gaussian smoothing
163163
164-
Returns:
164+
Returns
165165
-------
166166
NDArray:
167167
Smoothed array

src/pyrho/utils.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def pad_arr(arr_in: NDArray, shape: List[int]) -> NDArray:
5151
shape:
5252
Desired shape of the array
5353
54-
Returns:
54+
Returns
5555
-------
5656
NDArray:
5757
padded data
@@ -117,7 +117,7 @@ def interpolate_fourier(arr_in: NDArray, shape: List[int]) -> NDArray:
117117
shape:
118118
Desired shape shape of the interpolated data
119119
120-
Returns:
120+
Returns
121121
-------
122122
NDArray:
123123
Interpolated data in the desired shape
@@ -144,7 +144,7 @@ def roll_array(arr: NDArray, roll_vec: List[int]) -> NDArray:
144144
roll_vec:
145145
number of indices in each direction to roll
146146
147-
Returns:
147+
Returns
148148
-------
149149
NDArray:
150150
The rolled array
@@ -194,7 +194,7 @@ def get_sc_interp(
194194
origin:
195195
Shift applied to the origin in fractional coordinates
196196
197-
Returns:
197+
Returns
198198
-------
199199
NDArray:
200200
size ``(ndim x prod(grid_size))`` the cartesian coordinates of each point in the new data
@@ -238,7 +238,7 @@ def get_padded_array(data_in: NDArray) -> NDArray:
238238
data_in:
239239
Array to be padded
240240
241-
Returns:
241+
Returns
242242
-------
243243
NDArray:
244244
Padded array
@@ -267,7 +267,7 @@ def get_plane_spacing(lattice: NDArray) -> List[float]:
267267
lattice:
268268
List of lattice vectors in cartesian coordinates
269269
270-
Returns:
270+
Returns
271271
-------
272272
List[float]:
273273
List where the k-th element is is the spacing of planes generated by all
@@ -312,7 +312,7 @@ def get_ucell_frac_fit_sphere(lattice: np.ndarray, r: float = 0.2) -> Iterable[f
312312
r:
313313
width of the sphere
314314
315-
Returns:
315+
Returns
316316
-------
317317
Iterable of floats
318318
fraction of lattice vector in each direction need to fit the sphere
@@ -347,7 +347,7 @@ def gaussian_smear(
347347
multiple:
348348
``multiple * sigma`` is the cutoff radius for the smearing
349349
350-
Returns:
350+
Returns
351351
-------
352352
NDArray:
353353
The smear data array.

src/pyrho/vis/scatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def get_scatter_plot(
4848
Plotter to use, either "matplotlib" or "plotly"
4949
5050
51-
Returns:
51+
Returns
5252
-------
5353
Figure | Axes:
5454
`Figure` object or `Axes` object from matplotlib to be rendered in a notebook

0 commit comments

Comments
 (0)