micress-micpy 0.2.15b0__py3-none-any.whl → 0.2.16b0__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.
micpy/bin.py CHANGED
@@ -706,7 +706,7 @@ class File:
706
706
 
707
707
  Args:
708
708
  shape (Tuple[int, int, int]): Shape of the geometry.
709
- spacing (Tuple[float, float, float]): Spacing of the geometry.
709
+ spacing (Tuple[float, float, float]): Spacing of the geometry in μm³.
710
710
  """
711
711
 
712
712
  self.shape = np.array(shape)
@@ -726,7 +726,11 @@ class File:
726
726
  Defaults to True.
727
727
  """
728
728
  geo_dict = geo.read(filename, type=type, compressed=compressed)
729
- self.set_geo(geo_dict["shape"], geo_dict["spacing"])
729
+
730
+ shape = geo_dict["shape"]
731
+ spacing = utils.convert_si(geo_dict["spacing"], "cm", "μm")
732
+
733
+ self.set_geo(shape, spacing)
730
734
 
731
735
  def find_geo(self, type: geo.Type = geo.Type.EXTENDED, compressed: bool = None):
732
736
  """Find geometry file and read it.
micpy/utils.py CHANGED
@@ -4,6 +4,17 @@ import sys
4
4
  import time
5
5
 
6
6
 
7
+ def convert_si(value, unit_in, unit_out):
8
+ """Convert value from one SI unit to another SI unit."""
9
+ SI = {"μm": 0.000001, "mm": 0.001, "cm": 0.01, "m": 1.0}
10
+
11
+ if isinstance(value, (float, int)):
12
+ return value * SI[unit_in] / SI[unit_out]
13
+ elif isinstance(value, (tuple, list)):
14
+ return [v * SI[unit_in] / SI[unit_out] for v in value]
15
+ raise ValueError("Unsupported value type.")
16
+
17
+
7
18
  def progress_indicator(iterable, description="Progress", unit="Iteration", start=1):
8
19
  """Progress indicator for iterable."""
9
20
 
micpy/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.2.15b0"
1
+ __version__ = "0.2.16b0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: micress-micpy
3
- Version: 0.2.15b0
3
+ Version: 0.2.16b0
4
4
  Summary: MicPy is a Python package to facilitate MICRESS workflows.
5
5
  Author: Lukas Koschmieder
6
6
  Author-email: l.koschmieder@access-technology.de
@@ -0,0 +1,12 @@
1
+ micpy/__init__.py,sha256=7wQUaseppjQYZW1iAVNm2WSDjvBLlqtY8tiHsfDaW5Q,148
2
+ micpy/bin.py,sha256=1eO8nv3j3CNFFx35W2I-MdOTgelxVwOf3AzIv5-cnXY,26586
3
+ micpy/geo.py,sha256=dcXcxvAxPpe4Rrs1ImYs8H67c2228brabdefJMoLn0g,7354
4
+ micpy/matplotlib.py,sha256=toxFTtTaA-usuWUltMp0XufQee4-n68XH7SN2In2NZY,1845
5
+ micpy/tab.py,sha256=ZXhL6bg17W3jqFFX28htCOAV9W_W3op_-GD7iU5a_wY,3547
6
+ micpy/utils.py,sha256=-JS5SRqH4QMD6_pXBKPVw5zPNTbaqkcOUu9ej5Gi0QU,1282
7
+ micpy/version.py,sha256=MwwJ3Tq2WyMrlg5ARuI934Sn37GJtLQJ8y2GpYXfdw4,26
8
+ micress_micpy-0.2.16b0.dist-info/LICENSE,sha256=seHdCiArizUoWZ6bEFg6N3K2ZtfPK35wvOwg0kH-f6o,1488
9
+ micress_micpy-0.2.16b0.dist-info/METADATA,sha256=ZtkZWKBm6rCf4Bgwq8hKzO-sEdNkSpCBe7XDC5sF6EY,3824
10
+ micress_micpy-0.2.16b0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
11
+ micress_micpy-0.2.16b0.dist-info/top_level.txt,sha256=RiopkpW0AGNYdtOW2eQUWgm3yHGC13q9pWlHb2alhiE,6
12
+ micress_micpy-0.2.16b0.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- micpy/__init__.py,sha256=7wQUaseppjQYZW1iAVNm2WSDjvBLlqtY8tiHsfDaW5Q,148
2
- micpy/bin.py,sha256=0RB4FTad00sriZvQdHuTvkzT9D4_pLS_eFwpYS7EOhA,26492
3
- micpy/geo.py,sha256=dcXcxvAxPpe4Rrs1ImYs8H67c2228brabdefJMoLn0g,7354
4
- micpy/matplotlib.py,sha256=toxFTtTaA-usuWUltMp0XufQee4-n68XH7SN2In2NZY,1845
5
- micpy/tab.py,sha256=ZXhL6bg17W3jqFFX28htCOAV9W_W3op_-GD7iU5a_wY,3547
6
- micpy/utils.py,sha256=Kt1AvhMvWer9uftbb88X7N27aXtQdJl26grHmmm2vOQ,859
7
- micpy/version.py,sha256=tyiEmp3lrfZHINaXvAGtz6wbg_fRgizg1D1jsMt3PXo,26
8
- micress_micpy-0.2.15b0.dist-info/LICENSE,sha256=seHdCiArizUoWZ6bEFg6N3K2ZtfPK35wvOwg0kH-f6o,1488
9
- micress_micpy-0.2.15b0.dist-info/METADATA,sha256=Po-1cfNOIsV2m9wU_oj8kKzf2LllWQf-50PQD5O_g3c,3824
10
- micress_micpy-0.2.15b0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
11
- micress_micpy-0.2.15b0.dist-info/top_level.txt,sha256=RiopkpW0AGNYdtOW2eQUWgm3yHGC13q9pWlHb2alhiE,6
12
- micress_micpy-0.2.15b0.dist-info/RECORD,,