Skip to content

Commit

Permalink
Merge branch 'develop' into publish-gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Sep 24, 2024
2 parents 5ad44f7 + fd6c461 commit e955771
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
exclude: ^example/AlN-LDA/

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.5
rev: v0.6.7
hooks:
- id: ruff
args: [ "--fix", "--show-fixes" ]
Expand Down
22 changes: 10 additions & 12 deletions c/real_to_reciprocal.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ void r2r_real_to_reciprocal(lapack_complex_double *fc3_reciprocal,
const AtomTriplets *atom_triplets,
const long openmp_per_triplets) {
long i, j, num_band, num_patom, num_satom, adrs_vec;
lapack_complex_double *pre_phase_factors, *phase_factor0, *phase_factor1,
*phase_factor2;
lapack_complex_double *pre_phase_factors, *phase_factors, *phase_factor0,
*phase_factor1, *phase_factor2;

num_patom = atom_triplets->multi_dims[1];
num_satom = atom_triplets->multi_dims[0];
Expand All @@ -92,12 +92,11 @@ void r2r_real_to_reciprocal(lapack_complex_double *fc3_reciprocal,
pre_phase_factors[i] = get_pre_phase_factor(i, q_vecs, atom_triplets);
}

phase_factor0 = (lapack_complex_double *)malloc(
sizeof(lapack_complex_double) * num_patom * num_satom);
phase_factor1 = (lapack_complex_double *)malloc(
sizeof(lapack_complex_double) * num_patom * num_satom);
phase_factor2 = (lapack_complex_double *)malloc(
sizeof(lapack_complex_double) * num_patom * num_satom);
phase_factors = (lapack_complex_double *)malloc(
sizeof(lapack_complex_double) * 3 * num_patom * num_satom);
phase_factor0 = phase_factors;
phase_factor1 = phase_factors + num_patom * num_satom;
phase_factor2 = phase_factors + 2 * num_patom * num_satom;
for (i = 0; i < num_patom; i++) {
for (j = 0; j < num_satom; j++) {
adrs_vec = j * atom_triplets->multi_dims[1] + i;
Expand Down Expand Up @@ -132,11 +131,10 @@ void r2r_real_to_reciprocal(lapack_complex_double *fc3_reciprocal,

free(pre_phase_factors);
pre_phase_factors = NULL;
free(phase_factor0);
free(phase_factors);
phase_factors = NULL;
phase_factor0 = NULL;
phase_factor1 = NULL;
free(phase_factor1);
phase_factor1 = NULL;
free(phase_factor2);
phase_factor2 = NULL;
}

Expand Down
4 changes: 4 additions & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# Change Log

## Sep-24-2024: Version 3.5.2

- Fix a memory leak.

## Sep-19-2024: Version 3.5.1

- A small fix.
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
# The short X.Y version.
version = "3.5"
# The full version, including alpha/beta/rc tags.
release = "3.5.1"
release = "3.5.2"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 3 additions & 3 deletions phono3py/phonon3/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def primitive_symmetry(self) -> Symmetry:

def get_triplets_at_q(
self,
) -> tuple(np.ndarray, np.ndarray, np.ndarray, np.ndarray):
) -> tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
"""Return grid point triplets information.
triplets_at_q is in BZ-grid.
Expand Down Expand Up @@ -414,7 +414,7 @@ def get_zero_value_positions(self):
)
return self.zero_value_positions

def get_phonons(self) -> tuple(np.ndarray, np.ndarray, np.ndarray):
def get_phonons(self) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
"""Return phonons on grid.
Returns
Expand Down Expand Up @@ -538,7 +538,7 @@ def get_averaged_interaction(self):

def get_primitive_and_supercell_correspondence(
self,
) -> tuple(np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray):
) -> tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
"""Return atomic pair information."""
return (self._svecs, self._multi, self._p2s, self._s2p, self._masses)

Expand Down
2 changes: 1 addition & 1 deletion phono3py/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

__version__ = "3.5.1"
__version__ = "3.5.2"

0 comments on commit e955771

Please sign in to comment.