fakecbed 0.3.2__py3-none-any.whl → 0.3.4__py3-none-any.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.
fakecbed/discretized.py CHANGED
@@ -1482,6 +1482,11 @@ class CBEDPattern(fancytypes.PreSerializableAndUpdatable):
1482
1482
  illumination_support = self._illumination_support.cpu().detach().clone()
1483
1483
  illumination_support = illumination_support.numpy(force=True)
1484
1484
 
1485
+ if self._disk_supports is None:
1486
+ method_name = ("_calc_disk_supports"
1487
+ "_and_cache_select_intermediates")
1488
+ method_alias = getattr(self, method_name)
1489
+ self._disk_supports = method_alias(u_x, u_y)
1485
1490
  disk_supports = self._disk_supports.numpy(force=True)
1486
1491
 
1487
1492
  num_disks = self._num_disks
@@ -1701,11 +1706,12 @@ class CBEDPattern(fancytypes.PreSerializableAndUpdatable):
1701
1706
 
1702
1707
  apply_shot_noise = self._apply_shot_noise
1703
1708
  if apply_shot_noise == True:
1704
- np_rng = np.random.default_rng(self._rng_seed)
1705
- torch_rng_seed = np_rng.integers(low=0, high=2**32-1).item()
1706
- torch_rng = torch.Generator(device=u_x.device)
1707
- torch_rng = torch_rng.manual_seed(torch_rng_seed)
1708
- image = torch.poisson(image, torch_rng)
1709
+ # ``torch.poisson`` was occasionally causing CUDA errors.
1710
+ rng = np.random.default_rng(self._rng_seed)
1711
+ image = image.numpy(force=True)
1712
+ image = rng.poisson(image)
1713
+ image = torch.from_numpy(image)
1714
+ image = image.to(device=self._device, dtype=image.dtype)
1709
1715
 
1710
1716
  image = self._apply_detector_partition_inpainting(input_image=image)
1711
1717
 
fakecbed/version.py CHANGED
@@ -1,8 +1,13 @@
1
- # file generated by setuptools_scm
1
+ # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
+
4
+ __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
+
3
6
  TYPE_CHECKING = False
4
7
  if TYPE_CHECKING:
5
- from typing import Tuple, Union
8
+ from typing import Tuple
9
+ from typing import Union
10
+
6
11
  VERSION_TUPLE = Tuple[Union[int, str], ...]
7
12
  else:
8
13
  VERSION_TUPLE = object
@@ -12,5 +17,5 @@ __version__: str
12
17
  __version_tuple__: VERSION_TUPLE
13
18
  version_tuple: VERSION_TUPLE
14
19
 
15
- __version__ = version = '0.3.2'
16
- __version_tuple__ = version_tuple = (0, 3, 2)
20
+ __version__ = version = '0.3.4'
21
+ __version_tuple__ = version_tuple = (0, 3, 4)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: fakecbed
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: A Python library for generating quickly images that imitate convergent beam electron diffraction patterns.
5
5
  Author-email: Matthew Fitzpatrick <matthew.rc.fitzpatrick@gmail.com>
6
6
  Project-URL: Homepage, https://mrfitzpa.github.io/fakecbed
@@ -22,7 +22,7 @@ Requires-Python: >=3.8
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  Requires-Dist: distoptica>=0.3.3
25
- Requires-Dist: hyperspy[all]
25
+ Requires-Dist: hyperspy
26
26
  Provides-Extra: tests
27
27
  Requires-Dist: pytest-cov; extra == "tests"
28
28
  Provides-Extra: examples
@@ -36,6 +36,7 @@ Requires-Dist: numpydoc; extra == "docs"
36
36
  Requires-Dist: docutils; extra == "docs"
37
37
  Provides-Extra: all
38
38
  Requires-Dist: fakecbed[docs,examples,tests]; extra == "all"
39
+ Dynamic: license-file
39
40
 
40
41
  # Fake Convergence Beam Electron Diffraction (fakecbed)
41
42
 
@@ -0,0 +1,10 @@
1
+ fakecbed/__init__.py,sha256=iP73WNV_HZgxiVUVdesbJqlrhDGESooh1hlBs8kox9M,1342
2
+ fakecbed/discretized.py,sha256=8j2wFwGXNuf602cJui9ZsvbrGitnt6nAxDcNSbytekU,99658
3
+ fakecbed/shapes.py,sha256=TiqJBZI4JZib0Q6zfO0e-dh7ACjYhvAYUvEtIedoo74,116471
4
+ fakecbed/tds.py,sha256=mk5359ErIhdpCoTdHq9r1-foKb8t3qCOHqNoabx3bQw,8066
5
+ fakecbed/version.py,sha256=Mxups7YfGBY2vvCok_hLJKCtU6O1WHQJfsMY-bAJ0Yg,511
6
+ fakecbed-0.3.4.dist-info/licenses/LICENSE,sha256=N0P3pKtRMvfb64jmgJdlerg3TnS0a2QC776AzPsbZIg,35128
7
+ fakecbed-0.3.4.dist-info/METADATA,sha256=EMbTje8PeaQkEs54LEIrruABi7a8QNrn73FjBDHLJ9M,3023
8
+ fakecbed-0.3.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
+ fakecbed-0.3.4.dist-info/top_level.txt,sha256=l0jL8P0CjRiCSznYLnq7riaAnOmYaV3zjjjIJx9vjSQ,9
10
+ fakecbed-0.3.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,10 +0,0 @@
1
- fakecbed/__init__.py,sha256=iP73WNV_HZgxiVUVdesbJqlrhDGESooh1hlBs8kox9M,1342
2
- fakecbed/discretized.py,sha256=zniskVmHRyxnR-P_O7qvyHuk2nnujUx1zDI99QDN53U,99379
3
- fakecbed/shapes.py,sha256=TiqJBZI4JZib0Q6zfO0e-dh7ACjYhvAYUvEtIedoo74,116471
4
- fakecbed/tds.py,sha256=mk5359ErIhdpCoTdHq9r1-foKb8t3qCOHqNoabx3bQw,8066
5
- fakecbed/version.py,sha256=9jP8Fo8egXoMs_T3DFqSuJYg4n9o9mnwYubl_hnut4k,411
6
- fakecbed-0.3.2.dist-info/LICENSE,sha256=N0P3pKtRMvfb64jmgJdlerg3TnS0a2QC776AzPsbZIg,35128
7
- fakecbed-0.3.2.dist-info/METADATA,sha256=Jh0UTcfGaox7vLR_LUhIfdZeB7nzxrAR0gMK6rqFMcw,3006
8
- fakecbed-0.3.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
- fakecbed-0.3.2.dist-info/top_level.txt,sha256=l0jL8P0CjRiCSznYLnq7riaAnOmYaV3zjjjIJx9vjSQ,9
10
- fakecbed-0.3.2.dist-info/RECORD,,