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
tme/preprocessor.py CHANGED
@@ -16,8 +16,6 @@ from scipy.interpolate import interp1d, splrep, BSpline
16
16
  from scipy.optimize import differential_evolution, minimize
17
17
 
18
18
  from .types import NDArray
19
- from .backends import NumpyFFTWBackend
20
- from .matching_utils import euler_to_rotationmatrix
21
19
 
22
20
 
23
21
  class Preprocessor:
@@ -680,134 +678,14 @@ class Preprocessor:
680
678
  use_gaussian=gaussian_sigma == 0.0,
681
679
  )(shape=shape)["data"]
682
680
 
683
- def wedge_mask(
684
- self,
685
- shape: Tuple[int],
686
- tilt_angles: NDArray,
687
- opening_axes: NDArray = 0,
688
- sigma: float = 0,
689
- omit_negative_frequencies: bool = True,
690
- ) -> NDArray:
691
- """
692
- Create a wedge mask with the same shape as template by rotating a
693
- plane according to tilt angles. The DC component of the filter is at the origin.
694
-
695
- Parameters
696
- ----------
697
- shape : Tuple of ints
698
- Shape of the output wedge array.
699
- tilt_angles : NDArray
700
- Tilt angles in format d dimensions N tilts [d x N].
701
- opening_axes : NDArray
702
- Axis running through the void defined by the wedge in format (N,)
703
- sigma : float, optional
704
- Standard deviation for Gaussian kernel used for smoothing the wedge.
705
- omit_negative_frequencies : bool, optional
706
- Whether the wedge mask should omit negative frequencies, i.e. be
707
- applicable to symmetric Fourier transforms (see :obj:`numpy.fft.fftn`)
708
-
709
- Returns
710
- -------
711
- NDArray
712
- A numpy array containing the wedge mask.
713
-
714
- Examples
715
- --------
716
- >>> import numpy as np
717
- >>> from tme import Preprocessor
718
- >>> angles = np.zeros((3, 10))
719
- >>> angles[2, :] = np.linspace(-50, 55, 10)
720
- >>> wedge = Preprocessor().wedge_mask(
721
- >>> shape = (50,50,50),
722
- >>> tilt_angles = angles,
723
- >>> omit_negative_frequencies = True
724
- >>> )
725
- >>> wedge = np.fft.fftshift(wedge)
726
-
727
- This will create a wedge that is open along axis 1, tilted
728
- around axis 2 and propagated along axis 0. The code above would
729
- be equivalent to the following
730
-
731
- >>> wedge = Preprocessor().continuous_wedge_mask(
732
- >>> shape=(50,50,50),
733
- >>> start_tilt=50,
734
- >>> stop_tilt=55,
735
- >>> tilt_axis=1,
736
- >>> omit_negative_frequencies=False,
737
- >>> infinite_plane=False
738
- >>> )
739
- >>> wedge = np.fft.fftshift(wedge)
740
-
741
- with the difference being that :py:meth:`Preprocessor.continuous_wedge_mask`
742
- does not consider individual plane tilts.
743
-
744
- Raises
745
- ------
746
- ValueError
747
- If opening_axes is neither a single value or defined for each tilt.
748
-
749
- See Also
750
- --------
751
- :py:meth:`Preprocessor.step_wedge_mask`
752
- :py:meth:`Preprocessor.continuous_wedge_mask`
753
- """
754
- opening_axes = np.asarray(opening_axes)
755
- opening_axes = np.repeat(
756
- opening_axes, tilt_angles.shape[1] // opening_axes.size
757
- )
758
-
759
- if opening_axes.size != tilt_angles.shape[1]:
760
- raise ValueError(
761
- "opening_axes has to be a single value or be defined for each tilt."
762
- )
763
-
764
- plane = np.zeros(shape, dtype=np.float32)
765
- slices = tuple(slice(a, a + 1) for a in np.divide(shape, 2).astype(int))
766
- plane_rotated, wedge_volume = np.zeros_like(plane), np.zeros_like(plane)
767
- for index in range(tilt_angles.shape[1]):
768
- plane.fill(0)
769
- plane_rotated.fill(0)
770
-
771
- opening_axis = opening_axes[index]
772
- rotation_matrix = euler_to_rotationmatrix(
773
- np.roll(tilt_angles[:, index], opening_axis - 1)
774
- )
775
-
776
- subset = tuple(
777
- slice(None) if i != opening_axis else slices[opening_axis]
778
- for i in range(plane.ndim)
779
- )
780
- plane[subset] = 1
781
- NumpyFFTWBackend().rigid_transform(
782
- arr=plane,
783
- rotation_matrix=rotation_matrix,
784
- out=plane_rotated,
785
- use_geometric_center=True,
786
- order=1,
787
- )
788
- wedge_volume += plane_rotated
789
-
790
- wedge_volume = self.gaussian_filter(template=wedge_volume, sigma=sigma)
791
- wedge_volume = np.where(wedge_volume > np.exp(-2), 1, 0)
792
- wedge_volume = np.fft.ifftshift(wedge_volume)
793
-
794
- if omit_negative_frequencies:
795
- stop = 1 + (wedge_volume.shape[-1] // 2)
796
- wedge_volume = wedge_volume[..., :stop]
797
-
798
- return wedge_volume
799
-
800
681
  def step_wedge_mask(
801
682
  self,
802
- start_tilt: float,
803
- stop_tilt: float,
804
- tilt_step: float,
805
683
  shape: Tuple[int],
806
684
  tilt_angles: Tuple[float] = None,
807
685
  opening_axis: int = 0,
808
686
  tilt_axis: int = 2,
809
- sigma: float = 0,
810
- weights: float = 1,
687
+ weights: float = None,
688
+ infinite_plane: bool = False,
811
689
  omit_negative_frequencies: bool = True,
812
690
  ) -> NDArray:
813
691
  """
@@ -816,14 +694,8 @@ class Preprocessor:
816
694
 
817
695
  Parameters
818
696
  ----------
819
- start_tilt : float
820
- Starting tilt angle in degrees, e.g. a stage tilt of 70 degrees
821
- would yield a start_tilt value of 70.
822
- stop_tilt : float
823
- Ending tilt angle in degrees, , e.g. a stage tilt of -70 degrees
824
- would yield a stop_tilt value of 70.
825
- tilt_step : float
826
- Angle between the different tilt planes.
697
+ tilt_angles : tuple of float
698
+ Sequence of tilt angles.
827
699
  shape : Tuple of ints
828
700
  Shape of the output wedge array.
829
701
  tilt_axis : int, optional
@@ -849,70 +721,21 @@ class Preprocessor:
849
721
  NDArray
850
722
  A numpy array containing the wedge mask.
851
723
 
852
- Notes
853
- -----
854
- This function is equivalent to :py:meth:`Preprocessor.wedge_mask`, but much faster
855
- for large shapes because it only considers a single tilt angle rather than the rotation
856
- of an N-1 dimensional hyperplane in N dimensions.
857
-
858
724
  See Also
859
725
  --------
860
- :py:meth:`Preprocessor.wedge_mask`
861
726
  :py:meth:`Preprocessor.continuous_wedge_mask`
862
727
  """
863
- if tilt_angles is None:
864
- tilt_angles = np.arange(-start_tilt, stop_tilt + tilt_step, tilt_step)
865
-
866
- shape = tuple(int(x) for x in shape)
867
- opening_axis, tilt_axis = int(opening_axis), int(tilt_axis)
868
-
869
- weights = np.asarray(weights)
870
- weights = np.repeat(weights, tilt_angles.size // weights.size)
871
- plane = np.zeros((shape[opening_axis], shape[tilt_axis]), dtype=np.float32)
872
- subset = tuple(
873
- slice(None) if i != 0 else slice(x // 2, x // 2 + 1)
874
- for i, x in enumerate(plane.shape)
875
- )
876
- plane_rotated, wedge_volume = np.zeros_like(plane), np.zeros_like(plane)
877
- for index in range(tilt_angles.shape[0]):
878
- plane_rotated.fill(0)
879
- plane[subset] = weights[index]
880
- rotation_matrix = euler_to_rotationmatrix((tilt_angles[index], 0))
881
- rotation_matrix = rotation_matrix[np.ix_((0, 1), (0, 1))]
882
-
883
- NumpyFFTWBackend().rigid_transform(
884
- arr=plane,
885
- rotation_matrix=rotation_matrix,
886
- out=plane_rotated,
887
- use_geometric_center=True,
888
- order=1,
889
- )
890
- wedge_volume += plane_rotated
891
-
892
- # Ramp filtering would be more accurate
893
- np.fmin(wedge_volume, np.max(weights), wedge_volume)
894
-
895
- if sigma > 0:
896
- wedge_volume = self.gaussian_filter(template=wedge_volume, sigma=sigma)
897
-
898
- if opening_axis > tilt_axis:
899
- wedge_volume = np.moveaxis(wedge_volume, 1, 0)
900
-
901
- reshape_dimensions = tuple(
902
- x if i in (opening_axis, tilt_axis) else 1 for i, x in enumerate(shape)
903
- )
904
-
905
- wedge_volume = wedge_volume.reshape(reshape_dimensions)
906
- tile_dimensions = np.divide(shape, reshape_dimensions).astype(int)
907
- wedge_volume = np.tile(wedge_volume, tile_dimensions)
908
-
909
- wedge_volume = np.fft.ifftshift(wedge_volume)
910
-
911
- if omit_negative_frequencies:
912
- stop = 1 + (wedge_volume.shape[-1] // 2)
913
- wedge_volume = wedge_volume[..., :stop]
914
-
915
- return wedge_volume
728
+ from .preprocessing.tilt_series import WedgeReconstructed
729
+
730
+ return WedgeReconstructed(
731
+ angles=tilt_angles,
732
+ tilt_axis=tilt_axis,
733
+ opening_axis=opening_axis,
734
+ frequency_cutoff=None if infinite_plane else 0.5,
735
+ create_continuous_wedge=False,
736
+ weights=weights,
737
+ weight_wedge=weights is not None,
738
+ )(shape=shape, return_real_fourier=omit_negative_frequencies,)["data"]
916
739
 
917
740
  def continuous_wedge_mask(
918
741
  self,
@@ -921,8 +744,6 @@ class Preprocessor:
921
744
  shape: Tuple[int],
922
745
  opening_axis: int = 0,
923
746
  tilt_axis: int = 2,
924
- sigma: float = 0,
925
- extrude_plane: bool = True,
926
747
  infinite_plane: bool = True,
927
748
  omit_negative_frequencies: bool = True,
928
749
  ) -> NDArray:
@@ -950,13 +771,6 @@ class Preprocessor:
950
771
  - 2 for X-axis
951
772
  shape : Tuple of ints
952
773
  Shape of the output wedge array.
953
- sigma : float, optional
954
- Standard deviation for Gaussian kernel used for smoothing the wedge.
955
- extrude_plane : bool, optional
956
- Whether the tilted plane is extruded to 3D. By default, this represents
957
- the effect of rotating a plane in 3D yielding a cylinder with wedge
958
- insertion. If set to False, the returned mask has spherical shape,
959
- analogous to rotating a line in 3D.
960
774
  omit_negative_frequencies : bool, optional
961
775
  Whether the wedge mask should omit negative frequencies, i.e. be
962
776
  applicable to symmetric Fourier transforms (see :obj:`numpy.fft.fftn`)
@@ -970,55 +784,19 @@ class Preprocessor:
970
784
  Array of the specified shape with the wedge created based on
971
785
  the tilt angles.
972
786
 
973
- Examples
974
- --------
975
- >>> wedge = create_wedge(30, 60, 1, (64, 64, 64))
976
-
977
- Notes
978
- -----
979
- The rotation plane is spanned by the tilt axis and the leftmost dimension
980
- that is not the tilt axis.
981
-
982
787
  See Also
983
788
  --------
984
- :py:meth:`Preprocessor.wedge_mask`
985
789
  :py:meth:`Preprocessor.step_wedge_mask`
986
790
  """
987
- shape_center = np.divide(shape, 2).astype(int)
988
-
989
- grid = (np.indices(shape).T - shape_center).T
990
-
991
- start_radians = np.tan(np.radians(90 - start_tilt))
992
- stop_radians = np.tan(np.radians(-1 * (90 - stop_tilt)))
993
- max_tan_value = np.tan(np.radians(90)) + 1
994
-
995
- with np.errstate(divide="ignore", invalid="ignore"):
996
- ratios = np.where(
997
- grid[opening_axis] == 0,
998
- max_tan_value,
999
- grid[tilt_axis] / grid[opening_axis],
1000
- )
1001
-
1002
- wedge = np.logical_or(start_radians <= ratios, stop_radians >= ratios).astype(
1003
- np.float32
1004
- )
1005
-
1006
- if extrude_plane:
1007
- distances = np.sqrt(grid[tilt_axis] ** 2 + grid[opening_axis] ** 2)
1008
- else:
1009
- distances = np.linalg.norm(grid, axis=0)
1010
-
1011
- if not infinite_plane:
1012
- np.multiply(wedge, distances <= shape[tilt_axis] // 2, out=wedge)
1013
-
1014
- wedge = self.gaussian_filter(template=wedge, sigma=sigma)
1015
- wedge = np.fft.ifftshift(wedge > np.exp(-2))
1016
-
1017
- if omit_negative_frequencies:
1018
- stop = 1 + (wedge.shape[-1] // 2)
1019
- wedge = wedge[..., :stop]
1020
-
1021
- return wedge
791
+ from .preprocessing.tilt_series import WedgeReconstructed
792
+
793
+ return WedgeReconstructed(
794
+ angles=(start_tilt, stop_tilt),
795
+ tilt_axis=tilt_axis,
796
+ opening_axis=opening_axis,
797
+ frequency_cutoff=None if infinite_plane else 0.5,
798
+ create_continuous_wedge=True,
799
+ )(shape=shape, return_real_fourier=omit_negative_frequencies)["data"]
1022
800
 
1023
801
 
1024
802
  def window_kaiserb(width: int, beta: float = 3.2, order: int = 0) -> NDArray:
tme/structure.py CHANGED
@@ -344,7 +344,7 @@ class Structure:
344
344
  --------
345
345
  >>> from importlib_resources import files
346
346
  >>> from tme import Structure
347
- >>> fname = str(files("tme.tests.data").joinpath("Structures/5khe.cif"))
347
+ >>> fname = str(files("tests.data").joinpath("Structures/5khe.cif"))
348
348
  >>> structure = Structure.from_file(filename=fname)
349
349
  >>> structure
350
350
  Unique Chains: A-B, Atom Range: 1-1564 [N = 1564], Residue Range: 142-239 [N = 1564]
@@ -564,7 +564,7 @@ class Structure:
564
564
  >>> from importlib_resources import files
565
565
  >>> from tempfile import NamedTemporaryFile
566
566
  >>> from tme import Structure
567
- >>> fname = str(files("tme.tests.data").joinpath("Structures/5khe.cif"))
567
+ >>> fname = str(files("tests.data").joinpath("Structures/5khe.cif"))
568
568
  >>> oname = NamedTemporaryFile().name
569
569
  >>> structure = Structure.from_file(filename=fname)
570
570
  >>> structure.to_file(f"{oname}.cif") # Writes an mmCIF file to disk
@@ -760,7 +760,7 @@ class Structure:
760
760
  --------
761
761
  >>> from importlib_resources import files
762
762
  >>> from tme import Structure
763
- >>> fname = str(files("tme.tests.data").joinpath("Structures/5khe.cif"))
763
+ >>> fname = str(files("tests.data").joinpath("Structures/5khe.cif"))
764
764
  >>> structure = Structure.from_file(filename=fname)
765
765
  >>> structure.subset_by_chain(chain="A") # Keep A
766
766
  >>> structure.subset_by_chain(chain="A,B") # Keep A and B
@@ -804,7 +804,7 @@ class Structure:
804
804
  --------
805
805
  >>> from importlib_resources import files
806
806
  >>> from tme import Structure
807
- >>> fname = str(files("tme.tests.data").joinpath("Structures/5khe.cif"))
807
+ >>> fname = str(files("tests.data").joinpath("Structures/5khe.cif"))
808
808
  >>> structure = Structure.from_file(filename=fname)
809
809
  >>> structure.subset_by_range(chain="A",start=150,stop=180)
810
810
  """
@@ -827,7 +827,7 @@ class Structure:
827
827
  --------
828
828
  >>> from importlib_resources import files
829
829
  >>> from tme import Structure
830
- >>> fname = str(files("tme.tests.data").joinpath("Structures/5khe.cif"))
830
+ >>> fname = str(files("tests.data").joinpath("Structures/5khe.cif"))
831
831
  >>> structure = Structure.from_file(filename=fname)
832
832
  >>> structure.center_of_mass()
833
833
  array([-0.89391639, 29.94908928, -2.64736741])
@@ -863,7 +863,7 @@ class Structure:
863
863
  >>> from importlib_resources import files
864
864
  >>> from tme import Structure
865
865
  >>> from tme.matching_utils import get_rotation_matrices
866
- >>> fname = str(files("tme.tests.data").joinpath("Structures/5khe.cif"))
866
+ >>> fname = str(files("tests.data").joinpath("Structures/5khe.cif"))
867
867
  >>> structure = Structure.from_file(filename=fname)
868
868
  >>> structure.rigid_transform(
869
869
  >>> rotation_matrix = get_rotation_matrices(60)[2],
@@ -902,7 +902,7 @@ class Structure:
902
902
  --------
903
903
  >>> from importlib_resources import files
904
904
  >>> from tme import Structure
905
- >>> fname = str(files("tme.tests.data").joinpath("Structures/5khe.cif"))
905
+ >>> fname = str(files("tests.data").joinpath("Structures/5khe.cif"))
906
906
  >>> structure = Structure.from_file(filename=fname)
907
907
  >>> centered_structure, translation = structure.centered()
908
908
  >>> translation
@@ -1117,16 +1117,16 @@ class Structure:
1117
1117
  ----------
1118
1118
  positions : NDArray
1119
1119
  Array containing atomic positions in z,y,x format (n,d).
1120
- weights : [float]
1120
+ weights : tuple of float
1121
1121
  The weights to use for the entries in positions.
1122
- resolution : float
1122
+ resolution : float, optional
1123
1123
  The product of resolution and sigma_factor gives the sigma used to
1124
1124
  compute the discretized Gaussian.
1125
- sigma_factor : float
1125
+ sigma_factor : float, optional
1126
1126
  The factor used with resolution to compute sigma. Default is 1 / (π√2).
1127
- cutoff_value : float
1127
+ cutoff_value : float, optional
1128
1128
  The cutoff value for the Gaussian kernel. Default is 4.0.
1129
- sampling_rate : float
1129
+ sampling_rate : float, optional
1130
1130
  Sampling rate along each dimension. One third of resolution by default.
1131
1131
 
1132
1132
  References
@@ -1160,8 +1160,8 @@ class Structure:
1160
1160
  positions = positions[:, ::-1]
1161
1161
  origin = positions.min(axis=0) - pad * sampling_rate
1162
1162
  positions = np.rint(np.divide((positions - origin), sampling_rate)).astype(int)
1163
- shape = positions.max(axis=0).astype(int) + pad + 1
1164
1163
 
1164
+ shape = positions.max(axis=0).astype(int) + pad + 1
1165
1165
  out = np.zeros(shape, dtype=np.float32)
1166
1166
  np.add.at(out, tuple(positions.T), weights)
1167
1167
 
@@ -1225,17 +1225,17 @@ class Structure:
1225
1225
  origin : tuple of floats, optional
1226
1226
  Origin of the coordinate system in (z,y,x) form.
1227
1227
  chain : str, optional
1228
- Chain identified. Either single or comma separated string of chains.
1228
+ Chains to be included. Either single or comma separated string of chains.
1229
1229
  Defaults to None which returns all chains.
1230
1230
  weight_type : str, optional
1231
- Weight given to individual atoms. Supported weight are:
1231
+ Weight given to individual atoms. Supported weights are:
1232
1232
 
1233
1233
  +----------------------------+---------------------------------------+
1234
- | atomic_weight | Using element unit point mass |
1234
+ | atomic_weight | Using element weight point mass |
1235
1235
  +----------------------------+---------------------------------------+
1236
1236
  | atomic_number | Using atomic number point mass |
1237
1237
  +----------------------------+---------------------------------------+
1238
- | gaussian | Represent atoms as isotropic Gaussian |
1238
+ | gaussian | Using element weighted Gaussian mass |
1239
1239
  +----------------------------+---------------------------------------+
1240
1240
  | van_der_waals_radius | Using binary van der waal spheres |
1241
1241
  +----------------------------+---------------------------------------+
@@ -1256,7 +1256,7 @@ class Structure:
1256
1256
  --------
1257
1257
  >>> from importlib_resources import files
1258
1258
  >>> from tme import Structure
1259
- >>> fname = str(files("tme.tests.data").joinpath("Structures/5khe.cif"))
1259
+ >>> fname = str(files("tests.data").joinpath("Structures/5khe.cif"))
1260
1260
  >>> structure = Structure.from_file(filename=fname)
1261
1261
  >>> vol, origin, sampling = structure.to_volume()
1262
1262
  >>> vol.shape, origin, sampling
@@ -1299,10 +1299,10 @@ class Structure:
1299
1299
  )
1300
1300
 
1301
1301
  temp = self.subset_by_chain(chain=chain)
1302
- positions, atoms, shape, sampling_rate, origin = temp._coordinate_to_position(
1302
+ positions, atoms, _shape, sampling_rate, origin = temp._coordinate_to_position(
1303
1303
  shape=shape, sampling_rate=sampling_rate, origin=origin
1304
1304
  )
1305
- volume = np.zeros(shape, dtype=np.float32)
1305
+ volume = np.zeros(_shape, dtype=np.float32)
1306
1306
  if weight_type in ("atomic_weight", "atomic_number"):
1307
1307
  weights = temp._get_atom_weights(atoms=atoms, weight_type=weight_type)
1308
1308
  np.add.at(volume, tuple(positions.T), weights)
@@ -1374,7 +1374,7 @@ class Structure:
1374
1374
  >>> from importlib_resources import files
1375
1375
  >>> from tme.matching_utils import get_rotation_matrices
1376
1376
  >>> from tme import Structure
1377
- >>> fname = str(files("tme.tests.data").joinpath("Structures/5khe.cif"))
1377
+ >>> fname = str(files("tests.data").joinpath("Structures/5khe.cif"))
1378
1378
  >>> structure = Structure.from_file(filename=fname)
1379
1379
  >>> transformed = structure.rigid_transform(
1380
1380
  >>> rotation_matrix = get_rotation_matrices(60)[2],
@@ -1455,7 +1455,7 @@ class Structure:
1455
1455
  >>> from importlib_resources import files
1456
1456
  >>> from tme import Structure
1457
1457
  >>> from tme.matching_utils import get_rotation_matrices
1458
- >>> fname = str(files("tme.tests.data").joinpath("Structures/5khe.cif"))
1458
+ >>> fname = str(files("tests.data").joinpath("Structures/5khe.cif"))
1459
1459
  >>> structure = Structure.from_file(filename=fname)
1460
1460
  >>> transformed = structure.rigid_transform(
1461
1461
  >>> rotation_matrix = get_rotation_matrices(60)[2],
@@ -1,75 +0,0 @@
1
- pytme-0.2.3.data/scripts/estimate_ram_usage.py,sha256=R1NDpFajcF-MonJ4a43SfDlA-nxBYwK7D2quzCdsVFM,2767
2
- pytme-0.2.3.data/scripts/match_template.py,sha256=JJbZjxSdggKBHhEy-5lRwI6RslNzLAmZ9RPqwAnhkys,39750
3
- pytme-0.2.3.data/scripts/postprocess.py,sha256=50PwDfOWe2Fdws4J5K-k2SgM55fARlAWCnIsv-l0i-4,24414
4
- pytme-0.2.3.data/scripts/preprocess.py,sha256=fJMVyHJwiXorr8P2L47bVWSkduJYS3H5r-zrQpp4jjA,3782
5
- pytme-0.2.3.data/scripts/preprocessor_gui.py,sha256=mlxh-5GNaN7quEbd_Wso0R4gJ7DOJioL3rio2CCXuqw,39239
6
- scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- scripts/estimate_ram_usage.py,sha256=rN7haobnHg3YcgGJIp81FNiCzy8-saJGeEurQlmQmNQ,2768
8
- scripts/eval.py,sha256=ebJVLxbRlB6TI5YHNr0VavZ4lmaRdf8QVafyiDhh_oU,2528
9
- scripts/extract_candidates.py,sha256=DAfNyuauogWvSdRWIbtH44tsk9buLn13JrL1zJjJGLE,8373
10
- scripts/match_template.py,sha256=p4iS2_bp3ZdSgf0jB1t0SOojgCj-0KfwgRXHnLmfAHE,39751
11
- scripts/match_template_filters.py,sha256=Gj4a1b_S5NWp_dfFEPFn0D7jGf-qYgBbnTvZZ4bwqOQ,42036
12
- scripts/postprocess.py,sha256=FdA4AZgsbz8enYT6q46akWX4O5Hdxrun4PUdomYhrPA,24415
13
- scripts/preprocess.py,sha256=kZQd8SyMyLpHJzj59qSxtjFg2GMdhRuc5OQqoqj8Nh8,3783
14
- scripts/preprocessor_gui.py,sha256=_UaZyUViI8Xj-IDw18xjnyolB3ROMTFoLS-3Wqm7Uh0,39240
15
- scripts/refine_matches.py,sha256=Y17Ku_t0W9vglPNF2oU5EFrqoedJIm3lCGl-hXRHvjc,21920
16
- tme/__init__.py,sha256=liARhKZ565F2Y02iWRbFzfrTCkL5You3YaUSiqUkees,202
17
- tme/__version__.py,sha256=PNiDER4qM19h9zdsdfgKt2_dT4WgYK7EguJ8RU2qA_g,22
18
- tme/analyzer.py,sha256=kYxtzBCp02OJrlMME8Njh-9wIZAvsuhTHNAveNplssY,50466
19
- tme/density.py,sha256=BRM2jCDLvKDWDyzKhfc_APB4k398m9G5SnwFD1lRq8I,84204
20
- tme/extensions.cpython-311-darwin.so,sha256=KM0UcTYdq0Gib8rC6yVt7KnXrVvPNcWS-cvuYW2aPso,392496
21
- tme/matching_data.py,sha256=nEKG3DMwHwLjcO08sQUp6FiIkOLwtXS_36Y557nOvJQ,25319
22
- tme/matching_exhaustive.py,sha256=D5r53AyGNnGGsRgiNRo3L7YCrMeVCAgjlEurzDbLCv4,19483
23
- tme/matching_memory.py,sha256=bmCAUYyXWEet-1XXhldtc0irio2ytMSsAzWYyFI5LNM,11273
24
- tme/matching_optimization.py,sha256=Y8HfecXiOvAHXM1viBaQ_aXljqqTnGwlOlFe0MJpDRQ,45082
25
- tme/matching_scores.py,sha256=CECxl2Lh0TMLfZYnoCJXy3euGf8i9J0eHsAD7sqvWGU,30962
26
- tme/matching_utils.py,sha256=nh4D090eIrTO2d_Tjyr7FnLrTx3hRXie9mt5zJUFsZ4,39998
27
- tme/memory.py,sha256=6xeIMAncQkgYDi6w-PIYgFEWRTUPu0_OTCeRO0p9r9Q,11029
28
- tme/orientations.py,sha256=KsYXJuLRLYXRHsDjP9_Tn1jXxIVPSaYkw1wRrWH3nUQ,26027
29
- tme/parser.py,sha256=fNiCAdsWI4ql92F1Ob4suiVzpjUOBlh2lad1iNY_FP8,13772
30
- tme/preprocessor.py,sha256=ZhlP-8b4NzAzRogWOnk5DLNh_tqCMOpc4msQIJEKBTU,48566
31
- tme/structure.py,sha256=k5kgFNHkM2mUvXS7VAwaevltLC1mUxEiDhMW0TqTNjo,65834
32
- tme/types.py,sha256=NAY7C4qxE6yz-DXVtClMvFfoOV-spWGLNfpLATZ1LcU,442
33
- tme/backends/__init__.py,sha256=4S68W2WJNZ9t33QSrRs6aL3OIyEVFo_zVsqXjS1iWYA,5185
34
- tme/backends/_jax_utils.py,sha256=YuNJHCYnSqOESMV-9LPr-ZxBg6Zvax2euBjsZM-j-64,5906
35
- tme/backends/cupy_backend.py,sha256=1nnCJ4nT7tJsXu1mrJGCy7x0Yg1wWVRg4SdzsQ2qiiw,9284
36
- tme/backends/jax_backend.py,sha256=qRUQ6-j1gSUCeYDgla2qAO3ptnuCUar8uXC68B2lQ7Y,10344
37
- tme/backends/matching_backend.py,sha256=KfCOKD_rA9el3Y7BeH17KJ1apCUIIhhvn-vmbkb3CB0,33750
38
- tme/backends/mlx_backend.py,sha256=FJhqmCzgjXAjWGX1HhHFrCy_We4YwQQBkKFNG05ctzM,7788
39
- tme/backends/npfftw_backend.py,sha256=JDTc_1QcVi9jU3yLQF7jkgwQz_Po60OhkKuV2V3g5v8,16997
40
- tme/backends/pytorch_backend.py,sha256=61cAu8HBtGPDL8vSJx49f6yBxkLoWiX0X49Dy2tHAuk,15038
41
- tme/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
- tme/data/c48n309.npy,sha256=NwH64mOEbm3tStq5c98o81fY1vMOoq4nvXDAh7Z7iZg,296768
43
- tme/data/c48n527.npy,sha256=saSUMTa1R0MisPvgFL02a7IHQSwEZ-mJu0v3qJjg5AU,506048
44
- tme/data/c48n9.npy,sha256=bDVLV6mWjZHSQfeDc-MOCKKarfc1jaNeVvpoe2xMUy4,8768
45
- tme/data/c48u1.npy,sha256=JeXMFzFITs2ezdc3x5lp3jo1cHHHHVADSA1Tpf77kXs,1088
46
- tme/data/c48u1153.npy,sha256=ECiEximtYDWtIux3Fwe_EJlyn08gUqP85DN9gjkT9_k,1107008
47
- tme/data/c48u1201.npy,sha256=aceC_Jeienz_81X4520nPpZcg5tnRhbW795EqbpWkrg,1153088
48
- tme/data/c48u1641.npy,sha256=p4LwW3LzdTjrUUpA7H53RfNWxYfPX0XjeSwZ39Ac78Q,1575488
49
- tme/data/c48u181.npy,sha256=mLYXrv1YHLH6DsBp5MkxHkxlxgMnj1mw_KKI0udH-FY,173888
50
- tme/data/c48u2219.npy,sha256=p8TQeX8YHu4pdxnwJjEAlQWAPa66W7kpK96iZKZr9JE,2130368
51
- tme/data/c48u27.npy,sha256=k03ZNEsoPwBKCy8IeIa5G0WRZqjGZMtX6Ibu7EpJHvU,26048
52
- tme/data/c48u2947.npy,sha256=icI97ED6ct66y7FIaJAugmjzrIWk7CINCxtO3wDTnrU,2829248
53
- tme/data/c48u3733.npy,sha256=tla-__Pf-hpN6h04vtFIfkkFdCLple11VO06kr1dXkM,3583808
54
- tme/data/c48u4749.npy,sha256=tItOA4oV7SiqCCREwz3fyEpZoxM0lCq_jfEo5_-fp2s,4559168
55
- tme/data/c48u5879.npy,sha256=bFk89MllIFCX_sLXTYWFquSyN1NuahH4wwnEsPJLxzA,5643968
56
- tme/data/c48u7111.npy,sha256=CMy9kI2edH-q9eTIVdgUtXurplYNI7Uqp4dXfkkVdf8,6826688
57
- tme/data/c48u815.npy,sha256=bCuJxLtm0Sjg3GGxtyjGzRYZ1G0Gz79XHI-71GvqQnI,782528
58
- tme/data/c48u83.npy,sha256=7ODJYnsiuDjGbgd9GFopsyIW2IjrYI0J2X2f-cK868U,79808
59
- tme/data/c48u8649.npy,sha256=-IPlpR4zrPQZWhhSPu4zEulFdrCEVgTMFffCB5d-huE,8303168
60
- tme/data/c600v.npy,sha256=JqSu3ALoL1A9iguehc0YGUMFPsh2fprHHp76VXeFXIw,2528
61
- tme/data/c600vc.npy,sha256=Yht-GFXDSjjGvsjFBvyxxEZAI-ODADPd5gEgFNZQVTA,14528
62
- tme/data/metadata.yaml,sha256=fAgX-mEzB0QMHTEtYDG4cSMbJhYxBbDJH3sdvJvL7a8,750
63
- tme/data/quat_to_numpy.py,sha256=-gkDZb10fKBxwfYrSLCUWvMB76TzZWELCeKsYProwws,1333
64
- tme/preprocessing/__init__.py,sha256=7O3vDzJcIfxovJkf7avWSPtzaIVlTbmsW7egQFukC_s,98
65
- tme/preprocessing/_utils.py,sha256=hC8Qfh_a_fk4o7v82c4-TZYYRFfo5XttcghvpkzBo0A,6193
66
- tme/preprocessing/composable_filter.py,sha256=dOE1WDzF3xc-Chv63PWSiW3Gq4wXyAbvNvKuy-lERL8,780
67
- tme/preprocessing/compose.py,sha256=tilp14UhBh98SJVJhC_STbgi7i8HeU4FB7B7KUOD8gc,1458
68
- tme/preprocessing/frequency_filters.py,sha256=x900ntX0QI46lDdycPISO-7K0XgM0015ksCOFlm-yM4,12964
69
- tme/preprocessing/tilt_series.py,sha256=PFzWuXUn-uTqj2gwt_y5IV2Cte1IcL-Ule26LYORe9M,33844
70
- pytme-0.2.3.dist-info/LICENSE,sha256=K1IUNSVAz8BXbpH5EA8y5FpaHdvFXnAF2zeK95Lr2bY,18467
71
- pytme-0.2.3.dist-info/METADATA,sha256=C6HajoocJkveHyDTm01adKSZjEIgI6AbYQEMTXuAhfE,5278
72
- pytme-0.2.3.dist-info/WHEEL,sha256=IHsX_ZtCj0uMf8jtN3eK3zfXfu1SfKRsLbDhsprnhR0,109
73
- pytme-0.2.3.dist-info/entry_points.txt,sha256=ff3LQL3FCWfCYOwFiP9zatm7laUbnwCkuPELkQVyUO4,241
74
- pytme-0.2.3.dist-info/top_level.txt,sha256=J8FUkazOb2fZ0n_KexnqCGyNOtie2bwisFSUBiM5-0w,12
75
- pytme-0.2.3.dist-info/RECORD,,