Skip to content

Commit 5da1a77

Browse files
authoredOct 3, 2024
Merge pull request #14 from bobleesj/time
Remove time dependency in pip, conda.txt
2 parents 8ea09f0 + fd5e68e commit 5da1a77

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed
 

‎news/time.rst

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* <news item>
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* remove time dependency in pip, conda.txt
20+
21+
**Security:**
22+
23+
* <news item>

‎requirements/conda.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
h5py
2-
time
32
tk
43
matplotlib-base
54
numpy

‎requirements/pip.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
h5py
2-
time
32
tk
43
matplotlib
54
numpy

‎src/diffpy/fourigui/fourigui.py

-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import time
21
import tkinter as tk
32
from tkinter.ttk import Button
43

@@ -392,15 +391,12 @@ def fft(self):
392391
"""
393392

394393
def perform_fft(fftholder):
395-
time0 = time.time()
396394
fftholder = np.nan_to_num(fftholder)
397395
size = list(fftholder.shape)
398396
fftholder = np.fft.ifftshift(fftholder)
399397
fftholder = np.fft.fftn(fftholder, s=size, norm="ortho")
400398
fftholder = np.fft.fftshift(fftholder)
401399
fftholder = fftholder.real
402-
fftdur = time.time() - time0
403-
print("- FFT performed in {} sec.".format(round(fftdur, 4)))
404400
return fftholder
405401

406402
if not self.transformed and not self.transcutted: # no fft at all yet
@@ -469,7 +465,6 @@ def applycutoff(self):
469465
"""
470466
if not self.cutted:
471467

472-
time0 = time.time()
473468
X, Y, Z = self.cube.shape
474469
sphere = np.ones((X, Y, Z))
475470
qmin = float(self.qminentry.get())
@@ -482,21 +477,18 @@ def applycutoff(self):
482477
R2 = (XS - X // 2) ** 2 + (YS - Y // 2) ** 2 + (ZS - Z // 2) ** 2
483478
mask = (R2 <= r2_inner) | (R2 >= r2_outer)
484479
sphere[mask] = np.nan
485-
cutdur = time.time() - time0
486480

487481
if self.space.get():
488482
self.cube_real = self.cube
489483
self.cube = self.cube_reci * sphere
490484
self.cube_recicut = self.cube
491-
print("- Cutoff below {} and beyond {} in {} sec.".format(qmin, qmax, round(cutdur, 4)))
492485
self.fft()
493486
else:
494487
self.cube_reci = self.cube
495488
self.cube = self.cube * sphere
496489
self.cube_recicut = self.cube
497490
self.plot_plane()
498491
self.intensity_upd_global()
499-
print("- Cutoff below {} and beyond {} in {} sec.".format(qmin, qmax, round(cutdur, 4)))
500492

501493
self.cutted = True
502494

0 commit comments

Comments
 (0)
Please sign in to comment.