fakecbed 0.3.2__tar.gz → 0.3.4__tar.gz

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 (41) hide show
  1. {fakecbed-0.3.2 → fakecbed-0.3.4}/PKG-INFO +4 -3
  2. {fakecbed-0.3.2 → fakecbed-0.3.4}/examples/basic_usage.ipynb +1 -1
  3. {fakecbed-0.3.2 → fakecbed-0.3.4}/fakecbed/discretized.py +11 -5
  4. {fakecbed-0.3.2 → fakecbed-0.3.4}/fakecbed/version.py +9 -4
  5. {fakecbed-0.3.2 → fakecbed-0.3.4}/fakecbed.egg-info/PKG-INFO +4 -3
  6. {fakecbed-0.3.2 → fakecbed-0.3.4}/fakecbed.egg-info/requires.txt +1 -1
  7. {fakecbed-0.3.2 → fakecbed-0.3.4}/pyproject.toml +1 -1
  8. {fakecbed-0.3.2 → fakecbed-0.3.4}/tests/test_discretized.py +18 -0
  9. {fakecbed-0.3.2 → fakecbed-0.3.4}/.coveragerc +0 -0
  10. {fakecbed-0.3.2 → fakecbed-0.3.4}/.github/workflows/measure_code_coverage.yml +0 -0
  11. {fakecbed-0.3.2 → fakecbed-0.3.4}/.github/workflows/publish_documentation_website.yml +0 -0
  12. {fakecbed-0.3.2 → fakecbed-0.3.4}/.github/workflows/publish_release_to_pypi.yml +0 -0
  13. {fakecbed-0.3.2 → fakecbed-0.3.4}/.github/workflows/test_library.yml +0 -0
  14. {fakecbed-0.3.2 → fakecbed-0.3.4}/.gitignore +0 -0
  15. {fakecbed-0.3.2 → fakecbed-0.3.4}/LICENSE +0 -0
  16. {fakecbed-0.3.2 → fakecbed-0.3.4}/README.md +0 -0
  17. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/INSTALL.rst +0 -0
  18. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/Makefile +0 -0
  19. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/_static/readthedocs_custom.css +0 -0
  20. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/_templates/custom_class_template.rst +0 -0
  21. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/_templates/custom_module_template.rst +0 -0
  22. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/_templates/versions.html +0 -0
  23. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/api.rst +0 -0
  24. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/build_docs.py +0 -0
  25. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/conf.py +0 -0
  26. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/examples.rst +0 -0
  27. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/index.rst +0 -0
  28. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/license.rst +0 -0
  29. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/literature.rst +0 -0
  30. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/make.bat +0 -0
  31. {fakecbed-0.3.2 → fakecbed-0.3.4}/docs/private_members_to_publish_to_docs.rst +0 -0
  32. {fakecbed-0.3.2 → fakecbed-0.3.4}/fakecbed/__init__.py +0 -0
  33. {fakecbed-0.3.2 → fakecbed-0.3.4}/fakecbed/shapes.py +0 -0
  34. {fakecbed-0.3.2 → fakecbed-0.3.4}/fakecbed/tds.py +0 -0
  35. {fakecbed-0.3.2 → fakecbed-0.3.4}/fakecbed.egg-info/SOURCES.txt +0 -0
  36. {fakecbed-0.3.2 → fakecbed-0.3.4}/fakecbed.egg-info/dependency_links.txt +0 -0
  37. {fakecbed-0.3.2 → fakecbed-0.3.4}/fakecbed.egg-info/top_level.txt +0 -0
  38. {fakecbed-0.3.2 → fakecbed-0.3.4}/setup.cfg +0 -0
  39. {fakecbed-0.3.2 → fakecbed-0.3.4}/setup.py +0 -0
  40. {fakecbed-0.3.2 → fakecbed-0.3.4}/tests/test_shapes.py +0 -0
  41. {fakecbed-0.3.2 → fakecbed-0.3.4}/tox.ini +0 -0
@@ -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
 
@@ -1293,7 +1293,7 @@
1293
1293
  "name": "python",
1294
1294
  "nbconvert_exporter": "python",
1295
1295
  "pygments_lexer": "ipython3",
1296
- "version": "3.12.7"
1296
+ "version": "3.11.13"
1297
1297
  }
1298
1298
  },
1299
1299
  "nbformat": 4,
@@ -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
 
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  distoptica>=0.3.3
2
- hyperspy[all]
2
+ hyperspy
3
3
 
4
4
  [all]
5
5
  fakecbed[docs,examples,tests]
@@ -35,7 +35,7 @@ keywords = [
35
35
  ]
36
36
  dependencies = [
37
37
  "distoptica>=0.3.3",
38
- "hyperspy[all]"
38
+ "hyperspy"
39
39
  ]
40
40
  requires-python = ">=3.8"
41
41
 
@@ -659,6 +659,24 @@ def test_8_of_CBEDPattern():
659
659
 
660
660
 
661
661
 
662
+ def test_9_of_CBEDPattern():
663
+ cbed_pattern = fakecbed.discretized.CBEDPattern()
664
+
665
+ num_pixels_across_pattern = \
666
+ cbed_pattern.core_attrs["num_pixels_across_pattern"]
667
+
668
+ overriding_image = np.zeros(2*(num_pixels_across_pattern,))
669
+
670
+ kwargs = {"overriding_image": overriding_image,
671
+ "skip_validation_and_conversion": False}
672
+ cbed_pattern.override_image_then_reapply_mask(**kwargs)
673
+
674
+ cbed_pattern_signal = cbed_pattern.get_signal(deep_copy=False)
675
+
676
+ return None
677
+
678
+
679
+
662
680
  ###########################
663
681
  ## Define error messages ##
664
682
  ###########################
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes