tinybrain 1.5.1__tar.gz → 1.7.0__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 (32) hide show
  1. {tinybrain-1.5.1 → tinybrain-1.7.0}/.github/workflows/build_wheel.yml +8 -4
  2. {tinybrain-1.5.1 → tinybrain-1.7.0}/.github/workflows/run_tests.yml +1 -1
  3. {tinybrain-1.5.1 → tinybrain-1.7.0}/ChangeLog +14 -0
  4. {tinybrain-1.5.1 → tinybrain-1.7.0}/PKG-INFO +22 -8
  5. {tinybrain-1.5.1 → tinybrain-1.7.0}/README.md +8 -3
  6. {tinybrain-1.5.1 → tinybrain-1.7.0}/automated_test.py +3 -3
  7. {tinybrain-1.5.1 → tinybrain-1.7.0}/setup.cfg +1 -1
  8. {tinybrain-1.5.1 → tinybrain-1.7.0}/setup.py +3 -3
  9. tinybrain-1.7.0/tinybrain/accelerated.hpp +1154 -0
  10. {tinybrain-1.5.1 → tinybrain-1.7.0}/tinybrain/accelerated.pyx +533 -168
  11. {tinybrain-1.5.1 → tinybrain-1.7.0}/tinybrain/downsample.py +3 -3
  12. {tinybrain-1.5.1 → tinybrain-1.7.0}/tinybrain.egg-info/PKG-INFO +22 -8
  13. tinybrain-1.7.0/tinybrain.egg-info/pbr.json +1 -0
  14. tinybrain-1.5.1/tinybrain/accelerated.hpp +0 -1122
  15. tinybrain-1.5.1/tinybrain.egg-info/pbr.json +0 -1
  16. {tinybrain-1.5.1 → tinybrain-1.7.0}/AUTHORS +0 -0
  17. {tinybrain-1.5.1 → tinybrain-1.7.0}/LICENSE +0 -0
  18. {tinybrain-1.5.1 → tinybrain-1.7.0}/build_linux.sh +0 -0
  19. {tinybrain-1.5.1 → tinybrain-1.7.0}/manylinux1.Dockerfile +0 -0
  20. {tinybrain-1.5.1 → tinybrain-1.7.0}/manylinux2010.Dockerfile +0 -0
  21. {tinybrain-1.5.1 → tinybrain-1.7.0}/manylinux2014.Dockerfile +0 -0
  22. {tinybrain-1.5.1 → tinybrain-1.7.0}/perf.py +0 -0
  23. {tinybrain-1.5.1 → tinybrain-1.7.0}/pyproject.toml +0 -0
  24. {tinybrain-1.5.1 → tinybrain-1.7.0}/requirements.txt +0 -0
  25. {tinybrain-1.5.1 → tinybrain-1.7.0}/requirements_dev.txt +0 -0
  26. {tinybrain-1.5.1 → tinybrain-1.7.0}/tinybrain/__init__.py +0 -0
  27. {tinybrain-1.5.1 → tinybrain-1.7.0}/tinybrain.egg-info/SOURCES.txt +0 -0
  28. {tinybrain-1.5.1 → tinybrain-1.7.0}/tinybrain.egg-info/dependency_links.txt +0 -0
  29. {tinybrain-1.5.1 → tinybrain-1.7.0}/tinybrain.egg-info/not-zip-safe +0 -0
  30. {tinybrain-1.5.1 → tinybrain-1.7.0}/tinybrain.egg-info/requires.txt +0 -0
  31. {tinybrain-1.5.1 → tinybrain-1.7.0}/tinybrain.egg-info/top_level.txt +0 -0
  32. {tinybrain-1.5.1 → tinybrain-1.7.0}/tox.ini +0 -0
@@ -28,12 +28,16 @@ jobs:
28
28
  uses: docker/setup-qemu-action@v1
29
29
 
30
30
  - name: Build wheels
31
- uses: pypa/cibuildwheel@v2.19.1
31
+ uses: joerick/cibuildwheel@v2.22.0
32
32
  # to supply options, put them in 'env', like:
33
33
  env:
34
- CIBW_ARCHS_LINUX: ${{matrix.arch}}
35
- CIBW_BEFORE_BUILD: pip install numpy setuptools wheel cython
34
+ CIBW_BEFORE_BUILD: pip install numpy pybind11 setuptools wheel pkginfo twine
35
+ CIBW_ARCHS_MACOS: "x86_64 arm64"
36
+ CIBW_ARCHS: auto64
36
37
 
37
- - uses: actions/upload-artifact@v2
38
+ - name: Upload built wheels
39
+ uses: actions/upload-artifact@v4
38
40
  with:
41
+ name: built-wheels-${{ matrix.os }}-${{ matrix.arch }}
39
42
  path: ./wheelhouse/*.whl
43
+ if-no-files-found: warn
@@ -14,7 +14,7 @@ jobs:
14
14
  runs-on: ${{ matrix.os }}
15
15
  strategy:
16
16
  matrix:
17
- os: [ubuntu-20.04, macos-latest, windows-2019]
17
+ os: [ubuntu-latest, macos-latest, windows-latest]
18
18
  python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
19
19
 
20
20
  steps:
@@ -1,6 +1,20 @@
1
1
  CHANGES
2
2
  =======
3
3
 
4
+ 1.7.0
5
+ -----
6
+
7
+ * fix: warnings about type comparison
8
+ * install: bump to c++17
9
+ * feat: add int8, int16 to downsample\_with\_averaging (#23)
10
+ * chore: update python compatible versions to drop 3.8 (EOL)
11
+ * docs: remove travis badge
12
+
13
+ 1.6.0
14
+ -----
15
+
16
+ * feat: support another dimension for downsampling (#21)
17
+
4
18
  1.5.1
5
19
  -----
6
20
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: tinybrain
3
- Version: 1.5.1
3
+ Version: 1.7.0
4
4
  Summary: Image pyramid generation specialized for connectomics data types and procedures.
5
5
  Home-page: https://github.com/seung-lab/tinybrain/
6
6
  Author: William Silversmith
@@ -9,19 +9,28 @@ Classifier: Intended Audience :: Developers
9
9
  Classifier: Development Status :: 5 - Production/Stable
10
10
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
11
11
  Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.8
13
12
  Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Topic :: Scientific/Engineering
18
- Requires-Python: >=3.8
18
+ Requires-Python: >=3.9
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  License-File: AUTHORS
22
22
  Requires-Dist: numpy
23
-
24
- [![Build Status](https://travis-ci.org/seung-lab/tinybrain.svg?branch=master)](https://travis-ci.org/seung-lab/tinybrain) [![PyPI version](https://badge.fury.io/py/tinybrain.svg)](https://badge.fury.io/py/tinybrain)
23
+ Dynamic: author
24
+ Dynamic: author-email
25
+ Dynamic: classifier
26
+ Dynamic: description
27
+ Dynamic: description-content-type
28
+ Dynamic: home-page
29
+ Dynamic: requires-dist
30
+ Dynamic: requires-python
31
+ Dynamic: summary
32
+
33
+ [![PyPI version](https://badge.fury.io/py/tinybrain.svg)](https://badge.fury.io/py/tinybrain)
25
34
 
26
35
  # tinybrain
27
36
 
@@ -37,7 +46,12 @@ img = load_3d_em_stack()
37
46
  img_pyramid = tinybrain.downsample_with_averaging(img, factor=(2,2,1), num_mips=5, sparse=False)
38
47
 
39
48
  labels = load_3d_labels()
40
- label_pyramid = tinybrain.downsample_segmentation(labels, factor=(2,2,1), num_mips=5, sparse=False))
49
+ label_pyramid = tinybrain.downsample_segmentation(labels, factor=(2,2,1), num_mips=5, sparse=False)
50
+
51
+ # We also have a few other types
52
+ img_pyramid = tinybrain.downsample_with_min_pooling(image, factor=(2,2,1), num_mips=5)
53
+ img_pyramid = tinybrain.downsample_with_max_pooling(image, factor=(2,2,1), num_mips=5)
54
+ img_pyramid = tinybrain.downsample_with_striding(image, factor=(2,2,1), num_mips=5)
41
55
  ```
42
56
 
43
57
  ## Installation
@@ -50,7 +64,7 @@ pip install tinybrain
50
64
  ## Motivation
51
65
 
52
66
  Image hierarchy generation in connectomics uses a few different techniques for
53
- visualizing data, but predominantly we create image pyramids of uint8 grayscale images using 2x2 average pooling and of uint8 to uint64 segmentation labels using 2x2 mode pooling. When images become very large and people wish to visualze upper mip levels using three axes at once, it becomes desirable to perform 2x2x2 downsamples to maintain isotropy.
67
+ visualizing data, but predominantly we create image pyramids of uint8 grayscale images using 2x2 average pooling and of uint8 to uint64 segmentation labels using 2x2 mode pooling. When images become very large and people wish to visualize upper mip levels using three axes at once, it becomes desirable to perform 2x2x2 downsamples to maintain isotropy.
54
68
 
55
69
  It's possible to compute both of these using numpy, however as multiple packages found it useful to copy the downsample functions, it makes sense to formalize these functions into a seperate library located on PyPI.
56
70
 
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.org/seung-lab/tinybrain.svg?branch=master)](https://travis-ci.org/seung-lab/tinybrain) [![PyPI version](https://badge.fury.io/py/tinybrain.svg)](https://badge.fury.io/py/tinybrain)
1
+ [![PyPI version](https://badge.fury.io/py/tinybrain.svg)](https://badge.fury.io/py/tinybrain)
2
2
 
3
3
  # tinybrain
4
4
 
@@ -14,7 +14,12 @@ img = load_3d_em_stack()
14
14
  img_pyramid = tinybrain.downsample_with_averaging(img, factor=(2,2,1), num_mips=5, sparse=False)
15
15
 
16
16
  labels = load_3d_labels()
17
- label_pyramid = tinybrain.downsample_segmentation(labels, factor=(2,2,1), num_mips=5, sparse=False))
17
+ label_pyramid = tinybrain.downsample_segmentation(labels, factor=(2,2,1), num_mips=5, sparse=False)
18
+
19
+ # We also have a few other types
20
+ img_pyramid = tinybrain.downsample_with_min_pooling(image, factor=(2,2,1), num_mips=5)
21
+ img_pyramid = tinybrain.downsample_with_max_pooling(image, factor=(2,2,1), num_mips=5)
22
+ img_pyramid = tinybrain.downsample_with_striding(image, factor=(2,2,1), num_mips=5)
18
23
  ```
19
24
 
20
25
  ## Installation
@@ -27,7 +32,7 @@ pip install tinybrain
27
32
  ## Motivation
28
33
 
29
34
  Image hierarchy generation in connectomics uses a few different techniques for
30
- visualizing data, but predominantly we create image pyramids of uint8 grayscale images using 2x2 average pooling and of uint8 to uint64 segmentation labels using 2x2 mode pooling. When images become very large and people wish to visualze upper mip levels using three axes at once, it becomes desirable to perform 2x2x2 downsamples to maintain isotropy.
35
+ visualizing data, but predominantly we create image pyramids of uint8 grayscale images using 2x2 average pooling and of uint8 to uint64 segmentation labels using 2x2 mode pooling. When images become very large and people wish to visualize upper mip levels using three axes at once, it becomes desirable to perform 2x2x2 downsamples to maintain isotropy.
31
36
 
32
37
  It's possible to compute both of these using numpy, however as multiple packages found it useful to copy the downsample functions, it makes sense to formalize these functions into a seperate library located on PyPI.
33
38
 
@@ -125,7 +125,7 @@ def test_even_odd2d():
125
125
  assert np.array_equal(oddimg, ans3x3x3)
126
126
  assert np.array_equal(oddimgf, ans3x3x3)
127
127
 
128
- @pytest.mark.parametrize("dtype", (np.uint8, np.uint16, np.float32, np.float64))
128
+ @pytest.mark.parametrize("dtype", (np.int8, np.int16, np.uint8, np.uint16, np.float32, np.float64))
129
129
  @pytest.mark.parametrize("sparse", [False, True])
130
130
  def test_accelerated_vs_numpy_avg_pooling_2x2x1(dtype, sparse):
131
131
  image = np.random.randint(0,255, size=(512, 512, 6), dtype=np.uint8).astype(dtype, copy=False)
@@ -147,7 +147,7 @@ def test_accelerated_vs_numpy_avg_pooling_2x2x1(dtype, sparse):
147
147
 
148
148
  assert np.all(mips[-1] == npimg)
149
149
 
150
- @pytest.mark.parametrize("dtype", (np.uint8, np.uint16, np.float32, np.float64))
150
+ @pytest.mark.parametrize("dtype", (np.int8, np.int16, np.uint8, np.uint16, np.float32, np.float64))
151
151
  def test_accelerated_vs_numpy_avg_pooling_2x2x1_simple_sparse(dtype):
152
152
  for x in [0,1]:
153
153
  for y in [0,1]:
@@ -189,7 +189,7 @@ def test_accelerated_vs_numpy_avg_pooling_2x2x1_simple_sparse(dtype):
189
189
  assert np.all(res[1] == ans)
190
190
 
191
191
 
192
- @pytest.mark.parametrize("dtype", (np.uint8, np.uint16, np.float32, np.float64))
192
+ @pytest.mark.parametrize("dtype", (np.int8, np.int16, np.uint8, np.uint16, np.float32, np.float64))
193
193
  @pytest.mark.parametrize("sx", (6,7,1024,1025))
194
194
  @pytest.mark.parametrize("sy", (6,7,1024,1025))
195
195
  @pytest.mark.parametrize("sz", (4,5,32,33))
@@ -13,11 +13,11 @@ classifier =
13
13
  Development Status :: 5 - Production/Stable
14
14
  License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
15
15
  Programming Language :: Python :: 3
16
- Programming Language :: Python :: 3.8
17
16
  Programming Language :: Python :: 3.9
18
17
  Programming Language :: Python :: 3.10
19
18
  Programming Language :: Python :: 3.11
20
19
  Programming Language :: Python :: 3.12
20
+ Programming Language :: Python :: 3.13
21
21
  Topic :: Scientific/Engineering
22
22
 
23
23
  [global]
@@ -17,13 +17,13 @@ class NumpyImport:
17
17
  extra_compile_args = []
18
18
  if sys.platform == 'win32':
19
19
  extra_compile_args += [
20
- '/std:c++11', '/O2'
20
+ '/std:c++17', '/O2'
21
21
  ]
22
22
  if platform.machine() == "x86_64":
23
23
  extra_compile_args += [ "/arch:SSE3" ]
24
24
  else:
25
25
  extra_compile_args += [
26
- '-std=c++11', '-O3' # '-DCYTHON_TRACE=1'
26
+ '-std=c++17', '-O3' # '-DCYTHON_TRACE=1'
27
27
  ]
28
28
  if platform.machine() == "x86_64":
29
29
  extra_compile_args += [ '-msse3' ]
@@ -34,7 +34,7 @@ if sys.platform == 'darwin':
34
34
  setuptools.setup(
35
35
  setup_requires=['pbr', 'numpy','cython'],
36
36
  install_requires=['numpy'],
37
- python_requires=">=3.8",
37
+ python_requires=">=3.9",
38
38
  ext_modules=[
39
39
  setuptools.Extension(
40
40
  'tinybrain.accelerated',