fakecbed 0.4.0__py3-none-any.whl → 0.5.1__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
@@ -2975,6 +2975,7 @@ class CroppedCBEDPattern(fancytypes.PreSerializableAndUpdatable):
2975
2975
  "_principal_disk_is_clipped",
2976
2976
  "_principal_disk_is_absent",
2977
2977
  "_disk_overlap_map",
2978
+ "_principal_disk_is_overlapping",
2978
2979
  "_principal_disk_analysis_results",
2979
2980
  "_principal_disk_bounding_box"
2980
2981
  "_in_uncropped_image_fractional_coords",
@@ -4505,6 +4506,191 @@ class CroppedCBEDPattern(fancytypes.PreSerializableAndUpdatable):
4505
4506
 
4506
4507
 
4507
4508
 
4509
+ def get_disk_overlap_map(self, deep_copy=_default_deep_copy):
4510
+ r"""Return the image of the disk overlap map of the cropped fake CBED
4511
+ pattern.
4512
+
4513
+ Parameters
4514
+ ----------
4515
+ deep_copy : `bool`, optional
4516
+ Let ``disk_overlap_map`` denote the attribute
4517
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.disk_overlap_map`.
4518
+
4519
+ If ``deep_copy`` is set to ``True``, then a deep copy of
4520
+ ``disk_overlap_map`` is returned. Otherwise, a reference to
4521
+ ``disk_overlap_map`` is returned.
4522
+
4523
+ Returns
4524
+ -------
4525
+ disk_overlap_map : `torch.Tensor` (`int`, ndim=2)
4526
+ The attribute
4527
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.disk_overlap_map`.
4528
+
4529
+ """
4530
+ params = {"deep_copy": deep_copy}
4531
+ deep_copy = _check_and_convert_deep_copy(params)
4532
+
4533
+ if self._disk_overlap_map is None:
4534
+ method_name = "_calc_disk_overlap_map"
4535
+ method_alias = getattr(self, method_name)
4536
+ self._disk_overlap_map = method_alias()
4537
+
4538
+ disk_overlap_map = (self._disk_overlap_map.detach().clone()
4539
+ if (deep_copy == True)
4540
+ else self._disk_overlap_map)
4541
+
4542
+ return disk_overlap_map
4543
+
4544
+
4545
+
4546
+ def _calc_disk_overlap_map(self):
4547
+ uncropped_cbed_pattern_disk_overlap_map = \
4548
+ self._cbed_pattern.get_disk_overlap_map(deep_copy=False)
4549
+ uncropped_cbed_pattern_disk_overlap_map = \
4550
+ uncropped_cbed_pattern_disk_overlap_map.cpu().detach().clone()
4551
+
4552
+ signal_to_crop = \
4553
+ self._generate_uncropped_blank_signal()
4554
+ signal_to_crop.data[2] = \
4555
+ uncropped_cbed_pattern_disk_overlap_map.numpy(force=True)
4556
+
4557
+ optional_params = self._generate_optional_cropping_params()
4558
+
4559
+ kwargs = {"input_signal": signal_to_crop,
4560
+ "optional_params": optional_params}
4561
+ cropped_signal = empix.crop(**kwargs)
4562
+
4563
+ N_W_h, N_W_v = self._cropping_window_dims_in_pixels
4564
+ L, R, B, T = self._mask_frame # Mask frame of cropped pattern.
4565
+
4566
+ disk_overlap_map = cropped_signal.data[2]
4567
+ disk_overlap_map_dtype = uncropped_cbed_pattern_disk_overlap_map.dtype
4568
+ disk_overlap_map = torch.from_numpy(disk_overlap_map)
4569
+ disk_overlap_map = disk_overlap_map.to(device=self._device,
4570
+ dtype=disk_overlap_map_dtype)
4571
+ disk_overlap_map[:T, :] = 0
4572
+ disk_overlap_map[max(N_W_v-B, 0):, :] = 0
4573
+ disk_overlap_map[:, :L] = 0
4574
+ disk_overlap_map[:, max(N_W_h-R, 0):] = 0
4575
+
4576
+ return disk_overlap_map
4577
+
4578
+
4579
+
4580
+ @property
4581
+ def disk_overlap_map(self):
4582
+ r"""`torch.Tensor`: The image of the disk overlap map of the cropped
4583
+ fake CBED pattern.
4584
+
4585
+ See the documentation for the attribute
4586
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.signal` for additional
4587
+ context.
4588
+
4589
+ Let ``signal``, ``device``, and ``core_attrs`` denote the attributes
4590
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.signal`,
4591
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.device`, and
4592
+ :attr:`~fancytypes.Checkable.core_attrs` respectively.
4593
+
4594
+ ``disk_overlap_map`` is calculated effectively by:
4595
+
4596
+ .. code-block:: python
4597
+
4598
+ N_W_h, N_W_v = core_attrs["cropping_window_dims_in_pixels"]
4599
+ L, R, B, T = core_attrs["mask_frame"]
4600
+
4601
+ disk_overlap_map = signal.data[2]
4602
+ disk_overlap_map = torch.from_numpy(disk_overlap_map)
4603
+ disk_overlap_map = disk_overlap_map.to(device=device, dtype=int)
4604
+ disk_overlap_map[:T, :] = 0
4605
+ disk_overlap_map[max(N_W_v-B, 0):, :] = 0
4606
+ disk_overlap_map[:, :L] = 0
4607
+ disk_overlap_map[:, max(N_W_h-R, 0):] = 0
4608
+
4609
+ Note that ``disk_overlap_map`` should be considered **read-only**.
4610
+
4611
+ """
4612
+ result = self.get_disk_overlap_map(deep_copy=True)
4613
+
4614
+ return result
4615
+
4616
+
4617
+
4618
+ @property
4619
+ def principal_disk_is_overlapping(self):
4620
+ r"""`bool`: Equals ``True`` if the "principal" CBED disk exists and is
4621
+ overlapping with another CBED disk in the image of the cropped fake CBED
4622
+ pattern.
4623
+
4624
+ See the summary documentation for the class
4625
+ :class:`fakecbed.discretized.CroppedCBEDPattern` for additional context,
4626
+ as well as the documentation for the attribute
4627
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.disk_overlap_map`.
4628
+
4629
+ Let ``core_attrs``, ``num_disks``, ``disk_supports``, and
4630
+ ``disk_overlap_map`` denote the attributes
4631
+ :attr:`~fancytypes.Checkable.core_attrs`,
4632
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.num_disks`,
4633
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.disk_supports`, and
4634
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.disk_overlap_map`
4635
+ respectively.
4636
+
4637
+ ``principal_disk_is_overlapping`` is calculated effectively by:
4638
+
4639
+ .. code-block:: python
4640
+
4641
+ principal_disk_idx = core_attrs["principal_disk_idx"]
4642
+
4643
+ principal_disk_support = (disk_supports[principal_disk_idx]
4644
+ if (principal_disk_idx < num_disks)
4645
+ else torch.zeros_like(disk_overlap_map))
4646
+
4647
+ principal_disk_is_overlapping = \
4648
+ torch.any(disk_overlap_map*principal_disk_support > 1.5).item()
4649
+
4650
+ Note that ``principal_disk_is_overlapping`` should be considered
4651
+ **read-only**.
4652
+
4653
+ """
4654
+ if self._principal_disk_is_overlapping is None:
4655
+ method_name = ("_calc_principal_disk_is_overlapping"
4656
+ "_and_cache_select_intermediates")
4657
+ method_alias = getattr(self, method_name)
4658
+ self._principal_disk_is_overlapping = method_alias()
4659
+
4660
+ result = self._principal_disk_is_overlapping
4661
+
4662
+ return result
4663
+
4664
+
4665
+
4666
+ def _calc_principal_disk_is_overlapping_and_cache_select_intermediates(
4667
+ self):
4668
+ principal_disk_idx = self._principal_disk_idx
4669
+ num_disks = self._num_disks
4670
+
4671
+ if self._disk_supports is None:
4672
+ method_name = "_calc_disk_supports"
4673
+ method_alias = getattr(self, method_name)
4674
+ self._disk_supports = method_alias()
4675
+ disk_supports = self._disk_supports
4676
+
4677
+ if self._disk_overlap_map is None:
4678
+ method_name = "_calc_disk_overlap_map"
4679
+ method_alias = getattr(self, method_name)
4680
+ self._disk_overlap_map = method_alias()
4681
+ disk_overlap_map = self._disk_overlap_map
4682
+
4683
+ principal_disk_support = (disk_supports[principal_disk_idx]
4684
+ if (principal_disk_idx < num_disks)
4685
+ else torch.zeros_like(disk_overlap_map))
4686
+
4687
+ principal_disk_is_overlapping = \
4688
+ torch.any(disk_overlap_map*principal_disk_support > 1.5).item()
4689
+
4690
+ return principal_disk_is_overlapping
4691
+
4692
+
4693
+
4508
4694
  def get_signal(self, deep_copy=_default_deep_copy):
4509
4695
  r"""Return the hyperspy signal representation of the cropped fake CBED
4510
4696
  pattern.
@@ -4576,11 +4762,11 @@ class CroppedCBEDPattern(fancytypes.PreSerializableAndUpdatable):
4576
4762
  self._generate_cropped_blank_signal().axes_manager
4577
4763
 
4578
4764
  signal.axes_manager[0].name = \
4579
- r"cropped fake CBED pattern attribute"
4765
+ "cropped fake CBED pattern attribute"
4580
4766
  signal.axes_manager[1].name = \
4581
- r"fractional horizontal coordinate of uncropped fake CBED pattern"
4767
+ "fractional horizontal coordinate of uncropped fake CBED pattern"
4582
4768
  signal.axes_manager[2].name = \
4583
- r"fractional vertical coordinate of uncropped fake CBED pattern"
4769
+ "fractional vertical coordinate of uncropped fake CBED pattern"
4584
4770
 
4585
4771
  return signal
4586
4772
 
@@ -4597,7 +4783,8 @@ class CroppedCBEDPattern(fancytypes.PreSerializableAndUpdatable):
4597
4783
  "_disk_clipping_registry",
4598
4784
  "_disk_absence_registry",
4599
4785
  "_principal_disk_is_clipped",
4600
- "_principal_disk_is_absent")
4786
+ "_principal_disk_is_absent",
4787
+ "_principal_disk_is_overlapping")
4601
4788
  for attr_name in attr_name_subset:
4602
4789
  attr = getattr(self, attr_name)
4603
4790
  if attr is None:
@@ -4660,12 +4847,19 @@ class CroppedCBEDPattern(fancytypes.PreSerializableAndUpdatable):
4660
4847
  :class:`fakecbed.discretized.CBEDPattern` and
4661
4848
  :class:`fakecbed.discretized.CroppedCBEDPattern` for additional context.
4662
4849
 
4663
- Let
4850
+ Let ``disk_clipping_registry``, ``disk_absence_registry``,
4851
+ ``principal_disk_is_clipped``, ``principal_disk_is_absent``,
4852
+ ``principal_disk_is_overlapping``,
4664
4853
  ``principal_disk_bounding_box_in_uncropped_image_fractional_coords``,
4665
4854
  ``principal_disk_bounding_box_in_cropped_image_fractional_coords``,
4666
4855
  ``principal_disk_boundary_pts_in_uncropped_image_fractional_coords``,
4667
4856
  ``principal_disk_boundary_pts_in_cropped_image_fractional_coords``, and
4668
4857
  ``core_attrs`` denote the attributes
4858
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.disk_clipping_registry`,
4859
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.disk_absence_registry`,
4860
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.principal_disk_is_clipped`,
4861
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.principal_disk_is_absent`,
4862
+ :attr:`fakecbed.discretized.CroppedCBEDPattern.principal_disk_is_overlapping`,
4669
4863
  :attr:`fakecbed.discretized.CroppedCBEDPattern.principal_disk_bounding_box_in_uncropped_image_fractional_coords`,
4670
4864
  :attr:`fakecbed.discretized.CroppedCBEDPattern.principal_disk_bounding_box_in_cropped_image_fractional_coords`,
4671
4865
  :attr:`fakecbed.discretized.CroppedCBEDPattern.principal_disk_boundary_pts_in_uncropped_image_fractional_coords`,
@@ -4727,46 +4921,96 @@ class CroppedCBEDPattern(fancytypes.PreSerializableAndUpdatable):
4727
4921
  kwargs["value"] = pre_serialize()
4728
4922
  signal.metadata.set_item(**kwargs)
4729
4923
 
4730
- tensor = \
4924
+ def _convert_attr_to_metadata_item(attr):
4925
+ if isinstance(attr, (tuple, bool)):
4926
+ metadata_item = \
4927
+ attr
4928
+ else:
4929
+ if len(attr.shape) == 1:
4930
+ metadata_item = \
4931
+ tuple(elem
4932
+ for elem
4933
+ in attr.cpu().detach().clone().tolist())
4934
+ else:
4935
+ metadata_item = \
4936
+ tuple(tuple(pt)
4937
+ for pt
4938
+ in attr.cpu().detach().clone().tolist())
4939
+
4940
+ return metadata_item
4941
+
4942
+ attr = disk_clipping_registry
4943
+ kwargs["item_path"] = "FakeCBED.disk_clipping_registry"
4944
+ kwargs["value"] = _convert_attr_to_metadata_item(attr)
4945
+ signal.metadata.set_item(**kwargs)
4946
+
4947
+ attr = disk_absence_registry
4948
+ kwargs["item_path"] = "FakeCBED.disk_absence_registry"
4949
+ kwargs["value"] = _convert_attr_to_metadata_item(attr)
4950
+ signal.metadata.set_item(**kwargs)
4951
+
4952
+ attr = principal_disk_is_clipped
4953
+ kwargs["item_path"] = "FakeCBED.principal_disk_is_clipped"
4954
+ kwargs["value"] = _convert_attr_to_metadata_item(attr)
4955
+ signal.metadata.set_item(**kwargs)
4956
+
4957
+ attr = principal_disk_is_absent
4958
+ kwargs["item_path"] = "FakeCBED.principal_disk_is_absent"
4959
+ kwargs["value"] = _convert_attr_to_metadata_item(attr)
4960
+ signal.metadata.set_item(**kwargs)
4961
+
4962
+ attr = principal_disk_is_overlapping
4963
+ kwargs["item_path"] = "FakeCBED.principal_disk_is_overlapping"
4964
+ kwargs["value"] = _convert_attr_to_metadata_item(attr)
4965
+ signal.metadata.set_item(**kwargs)
4966
+
4967
+ attr = \
4731
4968
  principal_disk_bounding_box_in_uncropped_image_fractional_coords
4732
4969
  kwargs["item_path"] = \
4733
4970
  ("FakeCBED.principal_disk_bounding_box"
4734
4971
  "_in_uncropped_image_fractional_coords")
4735
4972
  kwargs["value"] = \
4736
- tuple(tensor.cpu().detach().clone().tolist())
4973
+ _convert_attr_to_metadata_item(attr)
4737
4974
  _ = \
4738
4975
  signal.metadata.set_item(**kwargs)
4739
4976
 
4740
- tensor = \
4977
+ attr = \
4741
4978
  principal_disk_bounding_box_in_cropped_image_fractional_coords
4742
4979
  kwargs["item_path"] = \
4743
4980
  ("FakeCBED.principal_disk_bounding_box"
4744
4981
  "_in_cropped_image_fractional_coords")
4745
4982
  kwargs["value"] = \
4746
- tuple(tensor.cpu().detach().clone().tolist())
4983
+ _convert_attr_to_metadata_item(attr)
4747
4984
  _ = \
4748
4985
  signal.metadata.set_item(**kwargs)
4749
4986
 
4750
- tensor = \
4987
+ attr = \
4751
4988
  principal_disk_boundary_pts_in_uncropped_image_fractional_coords
4752
4989
  kwargs["item_path"] = \
4753
4990
  ("FakeCBED.principal_disk_boundary_pts"
4754
4991
  "_in_uncropped_image_fractional_coords")
4755
4992
  kwargs["value"] = \
4756
- tuple(tensor.cpu().detach().clone().tolist())
4993
+ _convert_attr_to_metadata_item(attr)
4757
4994
  _ = \
4758
4995
  signal.metadata.set_item(**kwargs)
4759
4996
 
4760
- tensor = \
4997
+ attr = \
4761
4998
  principal_disk_boundary_pts_in_cropped_image_fractional_coords
4762
4999
  kwargs["item_path"] = \
4763
5000
  ("FakeCBED.principal_disk_boundary_pts"
4764
5001
  "_in_cropped_image_fractional_coords")
4765
5002
  kwargs["value"] = \
4766
- tuple(tensor.cpu().detach().clone().tolist())
5003
+ _convert_attr_to_metadata_item(attr)
4767
5004
  _ = \
4768
5005
  signal.metadata.set_item(**kwargs)
4769
5006
 
5007
+ signal.axes_manager[0].name = \
5008
+ "cropped fake CBED pattern attribute"
5009
+ signal.axes_manager[1].name = \
5010
+ "fractional horizontal coordinate of uncropped fake CBED pattern"
5011
+ signal.axes_manager[2].name = \
5012
+ "fractional vertical coordinate of uncropped fake CBED pattern"
5013
+
4770
5014
  Note that ``signal`` should be considered **read-only**.
4771
5015
 
4772
5016
  """
@@ -5014,115 +5258,6 @@ class CroppedCBEDPattern(fancytypes.PreSerializableAndUpdatable):
5014
5258
 
5015
5259
 
5016
5260
 
5017
- def get_disk_overlap_map(self, deep_copy=_default_deep_copy):
5018
- r"""Return the image of the disk overlap map of the cropped fake CBED
5019
- pattern.
5020
-
5021
- Parameters
5022
- ----------
5023
- deep_copy : `bool`, optional
5024
- Let ``disk_overlap_map`` denote the attribute
5025
- :attr:`fakecbed.discretized.CroppedCBEDPattern.disk_overlap_map`.
5026
-
5027
- If ``deep_copy`` is set to ``True``, then a deep copy of
5028
- ``disk_overlap_map`` is returned. Otherwise, a reference to
5029
- ``disk_overlap_map`` is returned.
5030
-
5031
- Returns
5032
- -------
5033
- disk_overlap_map : `torch.Tensor` (`int`, ndim=2)
5034
- The attribute
5035
- :attr:`fakecbed.discretized.CroppedCBEDPattern.disk_overlap_map`.
5036
-
5037
- """
5038
- params = {"deep_copy": deep_copy}
5039
- deep_copy = _check_and_convert_deep_copy(params)
5040
-
5041
- if self._disk_overlap_map is None:
5042
- method_name = ("_calc_disk_overlap_map")
5043
- method_alias = getattr(self, method_name)
5044
- self._disk_overlap_map = method_alias()
5045
-
5046
- disk_overlap_map = (self._disk_overlap_map.detach().clone()
5047
- if (deep_copy == True)
5048
- else self._disk_overlap_map)
5049
-
5050
- return disk_overlap_map
5051
-
5052
-
5053
-
5054
- def _calc_disk_overlap_map(self):
5055
- uncropped_cbed_pattern_disk_overlap_map = \
5056
- self._cbed_pattern.get_disk_overlap_map(deep_copy=False)
5057
- uncropped_cbed_pattern_disk_overlap_map = \
5058
- uncropped_cbed_pattern_disk_overlap_map.cpu().detach().clone()
5059
-
5060
- signal_to_crop = \
5061
- self._generate_uncropped_blank_signal()
5062
- signal_to_crop.data[2] = \
5063
- uncropped_cbed_pattern_disk_overlap_map.numpy(force=True)
5064
-
5065
- optional_params = self._generate_optional_cropping_params()
5066
-
5067
- kwargs = {"input_signal": signal_to_crop,
5068
- "optional_params": optional_params}
5069
- cropped_signal = empix.crop(**kwargs)
5070
-
5071
- N_W_h, N_W_v = self._cropping_window_dims_in_pixels
5072
- L, R, B, T = self._mask_frame # Mask frame of cropped pattern.
5073
-
5074
- disk_overlap_map = cropped_signal.data[2]
5075
- disk_overlap_map_dtype = uncropped_cbed_pattern_disk_overlap_map.dtype
5076
- disk_overlap_map = torch.from_numpy(disk_overlap_map)
5077
- disk_overlap_map = disk_overlap_map.to(device=self._device,
5078
- dtype=disk_overlap_map_dtype)
5079
- disk_overlap_map[:T, :] = 0
5080
- disk_overlap_map[max(N_W_v-B, 0):, :] = 0
5081
- disk_overlap_map[:, :L] = 0
5082
- disk_overlap_map[:, max(N_W_h-R, 0):] = 0
5083
-
5084
- return disk_overlap_map
5085
-
5086
-
5087
-
5088
- @property
5089
- def disk_overlap_map(self):
5090
- r"""`torch.Tensor`: The image of the disk overlap map of the cropped
5091
- fake CBED pattern.
5092
-
5093
- See the documentation for the attribute
5094
- :attr:`fakecbed.discretized.CroppedCBEDPattern.signal` for additional
5095
- context.
5096
-
5097
- Let ``signal``, ``device``, and ``core_attrs`` denote the attributes
5098
- :attr:`fakecbed.discretized.CroppedCBEDPattern.signal`,
5099
- :attr:`fakecbed.discretized.CroppedCBEDPattern.device`, and
5100
- :attr:`~fancytypes.Checkable.core_attrs` respectively.
5101
-
5102
- ``disk_overlap_map`` is calculated effectively by:
5103
-
5104
- .. code-block:: python
5105
-
5106
- N_W_h, N_W_v = core_attrs["cropping_window_dims_in_pixels"]
5107
- L, R, B, T = core_attrs["mask_frame"]
5108
-
5109
- disk_overlap_map = signal.data[2]
5110
- disk_overlap_map = torch.from_numpy(disk_overlap_map)
5111
- disk_overlap_map = disk_overlap_map.to(device=device, dtype=int)
5112
- disk_overlap_map[:T, :] = 0
5113
- disk_overlap_map[max(N_W_v-B, 0):, :] = 0
5114
- disk_overlap_map[:, :L] = 0
5115
- disk_overlap_map[:, max(N_W_h-R, 0):] = 0
5116
-
5117
- Note that ``disk_overlap_map`` should be considered **read-only**.
5118
-
5119
- """
5120
- result = self.get_disk_overlap_map(deep_copy=True)
5121
-
5122
- return result
5123
-
5124
-
5125
-
5126
5261
  ###########################
5127
5262
  ## Define error messages ##
5128
5263
  ###########################
fakecbed/version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.4.0'
32
- __version_tuple__ = version_tuple = (0, 4, 0)
31
+ __version__ = version = '0.5.1'
32
+ __version_tuple__ = version_tuple = (0, 5, 1)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.4
2
+ Name: fakecbed
3
+ Version: 0.5.1
4
+ Summary: A Python library for generating quickly images that imitate convergent beam electron diffraction patterns.
5
+ Author-email: Matthew Fitzpatrick <matthew.rc.fitzpatrick@gmail.com>
6
+ Project-URL: Homepage, https://mrfitzpa.github.io/fakecbed
7
+ Project-URL: Repository, https://github.com/mrfitzpa/fakecbed
8
+ Keywords: pytorch,microscopy,diffraction,cbed
9
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Natural Language :: English
21
+ Requires-Python: >=3.8
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: distoptica>=0.4.0
25
+ Requires-Dist: empix>=0.0.6
26
+ Provides-Extra: tests
27
+ Requires-Dist: pytest-cov; extra == "tests"
28
+ Provides-Extra: examples
29
+ Requires-Dist: jupyter; extra == "examples"
30
+ Requires-Dist: ipympl; extra == "examples"
31
+ Provides-Extra: docs
32
+ Requires-Dist: sphinx<7; extra == "docs"
33
+ Requires-Dist: sphinx_rtd_theme; extra == "docs"
34
+ Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
35
+ Requires-Dist: numpydoc; extra == "docs"
36
+ Requires-Dist: docutils; extra == "docs"
37
+ Provides-Extra: all
38
+ Requires-Dist: fakecbed[docs,examples,tests]; extra == "all"
39
+ Dynamic: license-file
40
+
41
+ # Fake Convergence Beam Electron Diffraction (FakeCBED)
42
+
43
+ [![Test library](https://github.com/mrfitzpa/fakecbed/actions/workflows/test_library.yml/badge.svg)](https://github.com/mrfitzpa/fakecbed/actions/workflows/test_library.yml)
44
+ [![Code Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/mrfitzpa/adb03c4c54f978f44822ffa033fe6762/raw/fakecbed_coverage_badge.json)](https://github.com/mrfitzpa/fakecbed/actions/workflows/measure_code_coverage.yml)
45
+ [![Documentation](https://img.shields.io/badge/docs-read-brightgreen)](https://mrfitzpa.github.io/fakecbed)
46
+ [![PyPi Version](https://img.shields.io/pypi/v/fakecbed.svg)](https://pypi.org/project/fakecbed)
47
+ [![Conda-Forge Version](https://img.shields.io/conda/vn/conda-forge/fakecbed.svg)](https://anaconda.org/conda-forge/fakecbed)
48
+ [![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
49
+
50
+ `fakecbed` is a Python library for generating quickly images that imitate
51
+ convergent beam electron diffraction patterns.
52
+
53
+ Visit the `fakecbed` [website](https://mrfitzpa.github.io/fakecbed) for a web
54
+ version of the installation instructions, the reference guide, and the examples
55
+ archive.
56
+
57
+ The source code can be found in the [`fakecbed` GitHub
58
+ repository](https://github.com/mrfitzpa/fakecbed).
59
+
60
+
61
+
62
+ ## Table of contents
63
+
64
+ - [Instructions for installing and uninstalling
65
+ `fakecbed`](#instructions-for-installing-and-uninstalling-fakecbed)
66
+ - [Installing `fakecbed`](#installing-fakecbed)
67
+ - [Installing `fakecbed` using `pip`](#installing-fakecbed-using-pip)
68
+ - [Installing `fakecbed` using
69
+ `conda`](#installing-fakecbed-using-conda)
70
+ - [Uninstalling `fakecbed`](#uninstalling-fakecbed)
71
+ - [Learning how to use `fakecbed`](#learning-how-to-use-fakecbed)
72
+
73
+
74
+
75
+ ## Instructions for installing and uninstalling `fakecbed`
76
+
77
+
78
+
79
+ ### Installing `fakecbed`
80
+
81
+ For all installation scenarios, first open up the appropriate command line
82
+ interface. On Unix-based systems, you could open e.g. a terminal. On Windows
83
+ systems you could open e.g. an Anaconda Prompt as an administrator.
84
+
85
+ Before installing `fakecbed`, it is recommended that users install `PyTorch` in
86
+ the same environment that they intend to install `fakecbed` according to the
87
+ instructions given [here](https://pytorch.org/get-started/locally/) for their
88
+ preferred PyTorch installation option.
89
+
90
+
91
+
92
+ #### Installing `fakecbed` using `pip`
93
+
94
+ Before installing `fakecbed`, make sure that you have activated the (virtual)
95
+ environment in which you intend to install said package. After which, simply run
96
+ the following command:
97
+
98
+ pip install fakecbed
99
+
100
+ The above command will install the latest stable version of `fakecbed`.
101
+
102
+ To install the latest development version from the main branch of the [fakecbed
103
+ GitHub repository](https://github.com/mrfitzpa/fakecbed), one must first clone
104
+ the repository by running the following command:
105
+
106
+ git clone https://github.com/mrfitzpa/fakecbed.git
107
+
108
+ Next, change into the root of the cloned repository, and then run the following
109
+ command:
110
+
111
+ pip install .
112
+
113
+ Note that you must include the period as well. The above command executes a
114
+ standard installation of `fakecbed`.
115
+
116
+ Optionally, for additional features in `fakecbed`, one can install additional
117
+ dependencies upon installing `fakecbed`. To install a subset of additional
118
+ dependencies (along with the standard installation), run the following command
119
+ from the root of the repository:
120
+
121
+ pip install .[<selector>]
122
+
123
+ where `<selector>` can be one of the following:
124
+
125
+ * `tests`: to install the dependencies necessary for running unit tests;
126
+ * `examples`: to install the dependencies necessary for executing files stored
127
+ in `<root>/examples`, where `<root>` is the root of the repository;
128
+ * `docs`: to install the dependencies necessary for documentation generation;
129
+ * `all`: to install all of the above optional dependencies.
130
+
131
+ Alternatively, one can run:
132
+
133
+ pip install fakecbed[<selector>]
134
+
135
+ elsewhere in order to install the latest stable version of `fakecbed`, along
136
+ with the subset of additional dependencies specified by `<selector>`.
137
+
138
+
139
+
140
+ #### Installing `fakecbed` using `conda`
141
+
142
+ Before proceeding, make sure that you have activated the (virtual) `conda`
143
+ environment in which you intend to install said package. For Windows systems,
144
+ users must install `PyTorch` separately prior to following the remaining
145
+ instructions below.
146
+
147
+ To install `fakecbed` using the `conda` package manager, run the following
148
+ command:
149
+
150
+ conda install -c conda-forge fakecbed
151
+
152
+ The above command will install the latest stable version of `fakecbed`.
153
+
154
+
155
+
156
+ ### Uninstalling `fakecbed`
157
+
158
+ If `fakecbed` was installed using `pip`, then to uninstall, run the following
159
+ command:
160
+
161
+ pip uninstall fakecbed
162
+
163
+ If `fakecbed` was installed using `conda`, then to uninstall, run the following
164
+ command:
165
+
166
+ conda remove fakecbed
167
+
168
+
169
+
170
+ ## Learning how to use `fakecbed`
171
+
172
+ For those new to the `fakecbed` library, it is recommended that they take a look
173
+ at the [Examples](https://mrfitzpa.github.io/fakecbed/examples.html) page, which
174
+ contain code examples that show how one can use the `fakecbed` library. While
175
+ going through the examples, readers can consult the [fakecbed reference
176
+ guide](https://mrfitzpa.github.io/fakecbed/_autosummary/fakecbed.html) to
177
+ understand what each line of code is doing.
@@ -0,0 +1,10 @@
1
+ fakecbed/__init__.py,sha256=iP73WNV_HZgxiVUVdesbJqlrhDGESooh1hlBs8kox9M,1342
2
+ fakecbed/discretized.py,sha256=uV9tc8CC0K6GG1rGp2Nvq8p9qf6zLmp4lWTbKicmULE,205011
3
+ fakecbed/shapes.py,sha256=Lo4pg46lpBwGiUJB6Q3X6gxoaa1d9eRwwjG49gkZ2zY,116472
4
+ fakecbed/tds.py,sha256=mk5359ErIhdpCoTdHq9r1-foKb8t3qCOHqNoabx3bQw,8066
5
+ fakecbed/version.py,sha256=cYMOhuaBHd0MIZmumuccsEQ-AxM8LIJy9dsBAWgOpqE,704
6
+ fakecbed-0.5.1.dist-info/licenses/LICENSE,sha256=N0P3pKtRMvfb64jmgJdlerg3TnS0a2QC776AzPsbZIg,35128
7
+ fakecbed-0.5.1.dist-info/METADATA,sha256=NGCr4SUFD2W5hKMPPe1mv3YAHRvMQ4TlKUITz_hjVgQ,7023
8
+ fakecbed-0.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
+ fakecbed-0.5.1.dist-info/top_level.txt,sha256=l0jL8P0CjRiCSznYLnq7riaAnOmYaV3zjjjIJx9vjSQ,9
10
+ fakecbed-0.5.1.dist-info/RECORD,,
@@ -1,61 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: fakecbed
3
- Version: 0.4.0
4
- Summary: A Python library for generating quickly images that imitate convergent beam electron diffraction patterns.
5
- Author-email: Matthew Fitzpatrick <matthew.rc.fitzpatrick@gmail.com>
6
- Project-URL: Homepage, https://mrfitzpa.github.io/fakecbed
7
- Project-URL: Repository, https://github.com/mrfitzpa/fakecbed
8
- Keywords: pytorch,microscopy,diffraction,cbed
9
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
10
- Classifier: Development Status :: 5 - Production/Stable
11
- Classifier: Intended Audience :: Science/Research
12
- Classifier: Programming Language :: Python
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.8
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Programming Language :: Python :: 3.10
17
- Classifier: Programming Language :: Python :: 3.11
18
- Classifier: Programming Language :: Python :: 3.12
19
- Classifier: Operating System :: OS Independent
20
- Classifier: Natural Language :: English
21
- Requires-Python: >=3.8
22
- Description-Content-Type: text/markdown
23
- License-File: LICENSE
24
- Requires-Dist: distoptica>=0.4.0
25
- Requires-Dist: empix
26
- Requires-Dist: hyperspy
27
- Provides-Extra: tests
28
- Requires-Dist: pytest-cov; extra == "tests"
29
- Provides-Extra: examples
30
- Requires-Dist: jupyter; extra == "examples"
31
- Requires-Dist: ipympl; extra == "examples"
32
- Provides-Extra: docs
33
- Requires-Dist: sphinx<7; extra == "docs"
34
- Requires-Dist: sphinx_rtd_theme; extra == "docs"
35
- Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
36
- Requires-Dist: numpydoc; extra == "docs"
37
- Requires-Dist: docutils; extra == "docs"
38
- Provides-Extra: all
39
- Requires-Dist: fakecbed[docs,examples,tests]; extra == "all"
40
- Dynamic: license-file
41
-
42
- # Fake Convergence Beam Electron Diffraction (fakecbed)
43
-
44
- [![Test library](https://github.com/mrfitzpa/fakecbed/actions/workflows/test_library.yml/badge.svg)](https://github.com/mrfitzpa/fakecbed/actions/workflows/test_library.yml)
45
- [![Code Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/mrfitzpa/adb03c4c54f978f44822ffa033fe6762/raw/fakecbed_coverage_badge.json)](https://github.com/mrfitzpa/fakecbed/actions/workflows/measure_code_coverage.yml)
46
- [![Documentation](https://img.shields.io/badge/docs-read-brightgreen)](https://mrfitzpa.github.io/fakecbed)
47
- [![PyPi Version](https://img.shields.io/pypi/v/fakecbed.svg)](https://pypi.org/project/fakecbed)
48
- [![Conda-Forge Version](https://img.shields.io/conda/vn/conda-forge/fakecbed.svg)](https://anaconda.org/conda-forge/fakecbed)
49
- [![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
50
-
51
- `fakecbed` is a Python library for generating quickly images that imitate
52
- convergent beam electron diffraction patterns.
53
-
54
- Visit the `fakecbed` [website](https://mrfitzpa.github.io/fakecbed) for a web
55
- version of the installation instructions, the reference guide, and the examples
56
- archive.
57
-
58
- <!--
59
- For those reading raw .rst files, see file `docs/INSTALL.rst` for instructions
60
- on installing the `fakecbed` library.
61
- -->
@@ -1,10 +0,0 @@
1
- fakecbed/__init__.py,sha256=iP73WNV_HZgxiVUVdesbJqlrhDGESooh1hlBs8kox9M,1342
2
- fakecbed/discretized.py,sha256=OZMfP6svmM1X9nr9_HH9UneM7HeYCORnql6ub6VEiiY,199216
3
- fakecbed/shapes.py,sha256=Lo4pg46lpBwGiUJB6Q3X6gxoaa1d9eRwwjG49gkZ2zY,116472
4
- fakecbed/tds.py,sha256=mk5359ErIhdpCoTdHq9r1-foKb8t3qCOHqNoabx3bQw,8066
5
- fakecbed/version.py,sha256=2_0GUP7yBCXRus-qiJKxQD62z172WSs1sQ6DVpPsbmM,704
6
- fakecbed-0.4.0.dist-info/licenses/LICENSE,sha256=N0P3pKtRMvfb64jmgJdlerg3TnS0a2QC776AzPsbZIg,35128
7
- fakecbed-0.4.0.dist-info/METADATA,sha256=S6dfO2H9VfL8U83rZ4KbTZxGzOq1qkcEKWbEo84P91w,3044
8
- fakecbed-0.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
- fakecbed-0.4.0.dist-info/top_level.txt,sha256=l0jL8P0CjRiCSznYLnq7riaAnOmYaV3zjjjIJx9vjSQ,9
10
- fakecbed-0.4.0.dist-info/RECORD,,