pytme 0.2.3__cp311-cp311-macosx_14_0_arm64.whl → 0.2.5__cp311-cp311-macosx_14_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. {pytme-0.2.3.data → pytme-0.2.5.data}/scripts/match_template.py +8 -8
  2. {pytme-0.2.3.data → pytme-0.2.5.data}/scripts/preprocess.py +22 -6
  3. {pytme-0.2.3.data → pytme-0.2.5.data}/scripts/preprocessor_gui.py +9 -14
  4. {pytme-0.2.3.dist-info → pytme-0.2.5.dist-info}/METADATA +1 -1
  5. pytme-0.2.5.dist-info/RECORD +119 -0
  6. {pytme-0.2.3.dist-info → pytme-0.2.5.dist-info}/WHEEL +1 -1
  7. {pytme-0.2.3.dist-info → pytme-0.2.5.dist-info}/top_level.txt +1 -0
  8. scripts/match_template.py +8 -8
  9. scripts/preprocess.py +22 -6
  10. scripts/preprocessor_gui.py +9 -14
  11. tests/__init__.py +0 -0
  12. tests/data/.DS_Store +0 -0
  13. tests/data/Blurring/.DS_Store +0 -0
  14. tests/data/Blurring/blob_width18.npy +0 -0
  15. tests/data/Blurring/edgegaussian_sigma3.npy +0 -0
  16. tests/data/Blurring/gaussian_sigma2.npy +0 -0
  17. tests/data/Blurring/hamming_width6.npy +0 -0
  18. tests/data/Blurring/kaiserb_width18.npy +0 -0
  19. tests/data/Blurring/localgaussian_sigma0510.npy +0 -0
  20. tests/data/Blurring/mean_size5.npy +0 -0
  21. tests/data/Blurring/ntree_sigma0510.npy +0 -0
  22. tests/data/Blurring/rank_rank3.npy +0 -0
  23. tests/data/Maps/.DS_Store +0 -0
  24. tests/data/Maps/emd_8621.mrc.gz +0 -0
  25. tests/data/README.md +2 -0
  26. tests/data/Raw/.DS_Store +0 -0
  27. tests/data/Raw/em_map.map +0 -0
  28. tests/data/Structures/.DS_Store +0 -0
  29. tests/data/Structures/1pdj.cif +3339 -0
  30. tests/data/Structures/1pdj.pdb +1429 -0
  31. tests/data/Structures/5khe.cif +3685 -0
  32. tests/data/Structures/5khe.ent +2210 -0
  33. tests/data/Structures/5khe.pdb +2210 -0
  34. tests/data/Structures/5uz4.cif +70548 -0
  35. tests/preprocessing/__init__.py +0 -0
  36. tests/preprocessing/test_compose.py +76 -0
  37. tests/preprocessing/test_frequency_filters.py +178 -0
  38. tests/preprocessing/test_preprocessor.py +136 -0
  39. tests/preprocessing/test_utils.py +79 -0
  40. tests/test_analyzer.py +310 -0
  41. tests/test_backends.py +375 -0
  42. tests/test_density.py +508 -0
  43. tests/test_extensions.py +130 -0
  44. tests/test_matching_cli.py +283 -0
  45. tests/test_matching_data.py +162 -0
  46. tests/test_matching_exhaustive.py +162 -0
  47. tests/test_matching_memory.py +30 -0
  48. tests/test_matching_optimization.py +226 -0
  49. tests/test_matching_utils.py +326 -0
  50. tests/test_orientations.py +173 -0
  51. tests/test_packaging.py +95 -0
  52. tests/test_parser.py +33 -0
  53. tests/test_structure.py +243 -0
  54. tme/__init__.py +0 -1
  55. tme/__version__.py +1 -1
  56. tme/backends/jax_backend.py +3 -9
  57. tme/data/scattering_factors.pickle +0 -0
  58. tme/density.py +14 -10
  59. tme/external/bindings.cpp +332 -0
  60. tme/matching_data.py +14 -12
  61. tme/matching_exhaustive.py +17 -15
  62. tme/matching_optimization.py +215 -208
  63. tme/matching_utils.py +1 -0
  64. tme/preprocessing/_utils.py +14 -14
  65. tme/preprocessing/composable_filter.py +0 -2
  66. tme/preprocessing/compose.py +4 -4
  67. tme/preprocessing/frequency_filters.py +32 -35
  68. tme/preprocessing/tilt_series.py +198 -117
  69. tme/preprocessor.py +24 -246
  70. tme/structure.py +22 -22
  71. pytme-0.2.3.dist-info/RECORD +0 -75
  72. tme/matching_memory.py +0 -383
  73. {pytme-0.2.3.data → pytme-0.2.5.data}/scripts/estimate_ram_usage.py +0 -0
  74. {pytme-0.2.3.data → pytme-0.2.5.data}/scripts/postprocess.py +0 -0
  75. {pytme-0.2.3.dist-info → pytme-0.2.5.dist-info}/LICENSE +0 -0
  76. {pytme-0.2.3.dist-info → pytme-0.2.5.dist-info}/entry_points.txt +0 -0
@@ -20,7 +20,6 @@ class ComposableFilter(ABC):
20
20
 
21
21
  Parameters
22
22
  ----------
23
-
24
23
  *args : tuple
25
24
  Variable length argument list.
26
25
  **kwargs : dict
@@ -28,7 +27,6 @@ class ComposableFilter(ABC):
28
27
 
29
28
  Returns
30
29
  -------
31
-
32
30
  Dict
33
31
  A dictionary representing the result of the filtering operation.
34
32
  """
@@ -17,13 +17,13 @@ class Compose:
17
17
  This class allows composing multiple transformations together. Each transformation
18
18
  is expected to be a callable that accepts keyword arguments and returns metadata.
19
19
 
20
- Parameters:
21
- -----------
20
+ Parameters
21
+ ----------
22
22
  transforms : Tuple[object]
23
23
  A tuple containing transformation objects.
24
24
 
25
- Returns:
26
- --------
25
+ Returns
26
+ -------
27
27
  Dict
28
28
  Metadata resulting from the composed transformations.
29
29
 
@@ -18,12 +18,10 @@ from ._utils import fftfreqn, crop_real_fourier, shift_fourier, compute_fourier_
18
18
 
19
19
  class BandPassFilter:
20
20
  """
21
- This class provides methods to generate bandpass filters in Fourier space,
22
- either by directly specifying the frequency cutoffs (discrete_bandpass) or
23
- by using Gaussian functions (gaussian_bandpass).
21
+ Generate bandpass filters in Fourier space.
24
22
 
25
- Parameters:
26
- -----------
23
+ Parameters
24
+ ----------
27
25
  lowpass : float, optional
28
26
  The lowpass cutoff, defaults to None.
29
27
  highpass : float, optional
@@ -67,8 +65,8 @@ class BandPassFilter:
67
65
  """
68
66
  Generate a bandpass filter using discrete frequency cutoffs.
69
67
 
70
- Parameters:
71
- -----------
68
+ Parameters
69
+ ----------
72
70
  shape : tuple of int
73
71
  The shape of the bandpass filter.
74
72
  lowpass : float
@@ -84,8 +82,8 @@ class BandPassFilter:
84
82
  **kwargs : dict
85
83
  Additional keyword arguments.
86
84
 
87
- Returns:
88
- --------
85
+ Returns
86
+ -------
89
87
  BackendArray
90
88
  The bandpass filter in Fourier space.
91
89
  """
@@ -98,17 +96,18 @@ class BandPassFilter:
98
96
  shape_is_real_fourier=shape_is_real_fourier,
99
97
  compute_euclidean_norm=True,
100
98
  )
101
-
102
- lowpass = 0 if lowpass is None else lowpass
103
- highpass = 1e10 if highpass is None else highpass
99
+ grid = be.to_backend_array(grid)
100
+ sampling_rate = be.to_backend_array(sampling_rate)
104
101
 
105
102
  highcut = grid.max()
106
- if lowpass > 0:
107
- highcut = np.max(2 * sampling_rate / lowpass)
108
- lowcut = np.max(2 * sampling_rate / highpass)
103
+ if lowpass is not None:
104
+ highcut = be.max(2 * sampling_rate / lowpass)
109
105
 
110
- bandpass_filter = ((grid <= highcut) & (grid >= lowcut)) * 1.0
106
+ lowcut = 0
107
+ if highpass is not None:
108
+ lowcut = be.max(2 * sampling_rate / highpass)
111
109
 
110
+ bandpass_filter = ((grid <= highcut) & (grid >= lowcut)) * 1.0
112
111
  bandpass_filter = shift_fourier(
113
112
  data=bandpass_filter, shape_is_real_fourier=shape_is_real_fourier
114
113
  )
@@ -129,10 +128,10 @@ class BandPassFilter:
129
128
  **kwargs,
130
129
  ) -> BackendArray:
131
130
  """
132
- Generate a bandpass filter using Gaussian functions.
131
+ Generate a bandpass filter using Gaussians.
133
132
 
134
- Parameters:
135
- -----------
133
+ Parameters
134
+ ----------
136
135
  shape : tuple of int
137
136
  The shape of the bandpass filter.
138
137
  lowpass : float
@@ -148,8 +147,8 @@ class BandPassFilter:
148
147
  **kwargs : dict
149
148
  Additional keyword arguments.
150
149
 
151
- Returns:
152
- --------
150
+ Returns
151
+ -------
153
152
  BackendArray
154
153
  The bandpass filter in Fourier space.
155
154
  """
@@ -216,15 +215,13 @@ class BandPassFilter:
216
215
 
217
216
  class LinearWhiteningFilter:
218
217
  """
219
- This class provides methods to compute the spectrum of the input data and
220
- apply linear whitening to the Fourier coefficients.
218
+ Compute Fourier power spectrums and perform whitening.
221
219
 
222
- Parameters:
223
- -----------
220
+ Parameters
221
+ ----------
224
222
  **kwargs : Dict, optional
225
223
  Additional keyword arguments.
226
224
 
227
-
228
225
  References
229
226
  ----------
230
227
  .. [1] de Teresa-Trueba, I.; Goetz, S. K.; Mattausch, A.; Stojanovska, F.; Zimmerli, C. E.;
@@ -243,10 +240,10 @@ class LinearWhiteningFilter:
243
240
  data_rfft: BackendArray, n_bins: int = None, batch_dimension: int = None
244
241
  ) -> Tuple[BackendArray, BackendArray]:
245
242
  """
246
- Compute the spectrum of the input data.
243
+ Compute the power spectrum of the input data.
247
244
 
248
- Parameters:
249
- -----------
245
+ Parameters
246
+ ----------
250
247
  data_rfft : BackendArray
251
248
  The Fourier transform of the input data.
252
249
  n_bins : int, optional
@@ -254,8 +251,8 @@ class LinearWhiteningFilter:
254
251
  batch_dimension : int, optional
255
252
  Batch dimension to average over.
256
253
 
257
- Returns:
258
- --------
254
+ Returns
255
+ -------
259
256
  bins : BackendArray
260
257
  Array containing the bin indices for the spectrum.
261
258
  radial_averages : BackendArray
@@ -330,8 +327,8 @@ class LinearWhiteningFilter:
330
327
  """
331
328
  Apply linear whitening to the data and return the result.
332
329
 
333
- Parameters:
334
- -----------
330
+ Parameters
331
+ ----------
335
332
  data : BackendArray, optional
336
333
  The input data, defaults to None.
337
334
  data_rfft : BackendArray, optional
@@ -345,8 +342,8 @@ class LinearWhiteningFilter:
345
342
  **kwargs : Dict
346
343
  Additional keyword arguments.
347
344
 
348
- Returns:
349
- --------
345
+ Returns
346
+ -------
350
347
  Dict
351
348
  Filter data and associated parameters.
352
349
  """