ngsidekick 0.0.2__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 (27) hide show
  1. ngsidekick-0.0.2/.gitignore +192 -0
  2. ngsidekick-0.0.2/LICENSE +30 -0
  3. ngsidekick-0.0.2/PKG-INFO +91 -0
  4. ngsidekick-0.0.2/README.md +29 -0
  5. ngsidekick-0.0.2/pyproject.toml +60 -0
  6. ngsidekick-0.0.2/src/ngsidekick/__init__.py +22 -0
  7. ngsidekick-0.0.2/src/ngsidekick/annotations/__init__.py +0 -0
  8. ngsidekick-0.0.2/src/ngsidekick/annotations/local.py +405 -0
  9. ngsidekick-0.0.2/src/ngsidekick/annotations/precomputed/__init__.py +1 -0
  10. ngsidekick-0.0.2/src/ngsidekick/annotations/precomputed/_id.py +34 -0
  11. ngsidekick-0.0.2/src/ngsidekick/annotations/precomputed/_relationships.py +161 -0
  12. ngsidekick-0.0.2/src/ngsidekick/annotations/precomputed/_spatial.py +594 -0
  13. ngsidekick-0.0.2/src/ngsidekick/annotations/precomputed/_util.py +102 -0
  14. ngsidekick-0.0.2/src/ngsidekick/annotations/precomputed/_write_buffers.py +206 -0
  15. ngsidekick-0.0.2/src/ngsidekick/annotations/precomputed/compressed_morton.py +138 -0
  16. ngsidekick-0.0.2/src/ngsidekick/annotations/precomputed/precomputed.py +489 -0
  17. ngsidekick-0.0.2/src/ngsidekick/annotations/util.py +167 -0
  18. ngsidekick-0.0.2/src/ngsidekick/py.typed +2 -0
  19. ngsidekick-0.0.2/src/ngsidekick/segmentcolors.py +224 -0
  20. ngsidekick-0.0.2/src/ngsidekick/segmentprops/__init__.py +1 -0
  21. ngsidekick-0.0.2/src/ngsidekick/segmentprops/segmentprops.py +704 -0
  22. ngsidekick-0.0.2/src/ngsidekick/segmentprops/select_segment_properties.py +128 -0
  23. ngsidekick-0.0.2/src/ngsidekick/storage.py +147 -0
  24. ngsidekick-0.0.2/src/ngsidekick/util.py +36 -0
  25. ngsidekick-0.0.2/src/ngsidekick/video_tool_utils.py +367 -0
  26. ngsidekick-0.0.2/test_version.py +8 -0
  27. ngsidekick-0.0.2/upload-to-pypi.sh +34 -0
@@ -0,0 +1,192 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be added to the global gitignore or merged into this project gitignore. For a PyCharm
158
+ # project, it is recommended to include the following files:
159
+ # .idea/
160
+ # *.iml
161
+ # *.ipr
162
+ # *.iws
163
+
164
+ # VS Code
165
+ .vscode/
166
+
167
+ # macOS
168
+ .DS_Store
169
+ .AppleDouble
170
+ .LSOverride
171
+
172
+ # Windows
173
+ Thumbs.db
174
+ ehthumbs.db
175
+ Desktop.ini
176
+
177
+ # Linux
178
+ *~
179
+
180
+ # Temporary files
181
+ *.tmp
182
+ *.temp
183
+ *.swp
184
+ *.swo
185
+ *~
186
+
187
+ # IDE files
188
+ *.sublime-project
189
+ *.sublime-workspace
190
+
191
+ # Project specific
192
+ # Add any project-specific files or directories to ignore here
@@ -0,0 +1,30 @@
1
+ Copyright 2025 HHMI. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions are
5
+ met:
6
+
7
+ * Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+ * Redistributions in binary form must reproduce the above
10
+ copyright notice, this list of conditions and the following disclaimer
11
+ in the documentation and/or other materials provided with the
12
+ distribution.
13
+ * Neither the name of HHMI nor the names of its
14
+ contributors may be used to endorse or promote products derived from
15
+ this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+
29
+ Author: bergs@janelia.hhmi.org (Stuart Berg)
30
+ Written as part of the FlyEM Project at Janelia Farm Research Center.
@@ -0,0 +1,91 @@
1
+ Metadata-Version: 2.4
2
+ Name: ngsidekick
3
+ Version: 0.0.2
4
+ Summary: Tools for neuroglancer scenes.
5
+ Project-URL: Homepage, https://github.com/janelia-flyem/ngsidekick
6
+ Project-URL: Repository, https://github.com/janelia-flyem/ngsidekick
7
+ Project-URL: Issues, https://github.com/janelia-flyem/ngsidekick/issues
8
+ Author-email: Stuart Berg <bergs@janelia.hhmi.org>
9
+ License: Copyright 2025 HHMI. All rights reserved.
10
+
11
+ Redistribution and use in source and binary forms, with or without
12
+ modification, are permitted provided that the following conditions are
13
+ met:
14
+
15
+ * Redistributions of source code must retain the above copyright
16
+ notice, this list of conditions and the following disclaimer.
17
+ * Redistributions in binary form must reproduce the above
18
+ copyright notice, this list of conditions and the following disclaimer
19
+ in the documentation and/or other materials provided with the
20
+ distribution.
21
+ * Neither the name of HHMI nor the names of its
22
+ contributors may be used to endorse or promote products derived from
23
+ this software without specific prior written permission.
24
+
25
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
+
37
+ Author: bergs@janelia.hhmi.org (Stuart Berg)
38
+ Written as part of the FlyEM Project at Janelia Farm Research Center.
39
+ License-File: LICENSE
40
+ Keywords: connectomics,neuroglancer,visualization
41
+ Classifier: License :: OSI Approved :: BSD License
42
+ Classifier: Programming Language :: Python :: 3
43
+ Classifier: Programming Language :: Python :: 3 :: Only
44
+ Classifier: Programming Language :: Python :: 3.10
45
+ Classifier: Programming Language :: Python :: 3.11
46
+ Classifier: Programming Language :: Python :: 3.12
47
+ Classifier: Programming Language :: Python :: 3.13
48
+ Classifier: Programming Language :: Python :: 3.14
49
+ Requires-Python: >=3.10
50
+ Requires-Dist: neuroglancer
51
+ Requires-Dist: numba
52
+ Requires-Dist: numpy
53
+ Requires-Dist: pandas
54
+ Requires-Dist: requests
55
+ Requires-Dist: tensorstore
56
+ Requires-Dist: tqdm
57
+ Provides-Extra: gcs
58
+ Requires-Dist: google-cloud-storage; extra == 'gcs'
59
+ Provides-Extra: test
60
+ Requires-Dist: pytest>=7; extra == 'test'
61
+ Description-Content-Type: text/markdown
62
+
63
+ # NGSidekick
64
+
65
+ Tools for neuroglancer scenes.
66
+
67
+
68
+ ## Installation
69
+
70
+ - Using uv:
71
+
72
+ ```bash
73
+ uv add ngsidekick
74
+ # or in an existing environment
75
+ uv pip install ngsidekick
76
+ ```
77
+
78
+ ## Development
79
+
80
+ Create an environment and run tests:
81
+
82
+ ```bash
83
+ uv venv
84
+ uv pip install -e .[test]
85
+ pytest
86
+ ```
87
+
88
+ ## License
89
+
90
+ BSD-3-Clause; see `LICENSE`.
91
+
@@ -0,0 +1,29 @@
1
+ # NGSidekick
2
+
3
+ Tools for neuroglancer scenes.
4
+
5
+
6
+ ## Installation
7
+
8
+ - Using uv:
9
+
10
+ ```bash
11
+ uv add ngsidekick
12
+ # or in an existing environment
13
+ uv pip install ngsidekick
14
+ ```
15
+
16
+ ## Development
17
+
18
+ Create an environment and run tests:
19
+
20
+ ```bash
21
+ uv venv
22
+ uv pip install -e .[test]
23
+ pytest
24
+ ```
25
+
26
+ ## License
27
+
28
+ BSD-3-Clause; see `LICENSE`.
29
+
@@ -0,0 +1,60 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27", "hatch-vcs"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "ngsidekick"
7
+ description = "Tools for neuroglancer scenes."
8
+ readme = "README.md"
9
+ requires-python = ">=3.10"
10
+ license = { file = "LICENSE" }
11
+ authors = [
12
+ { name = "Stuart Berg", email = "bergs@janelia.hhmi.org" }
13
+ ]
14
+ keywords = ["neuroglancer", "connectomics", "visualization"]
15
+ classifiers = [
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3 :: Only",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Programming Language :: Python :: 3.14",
23
+ "License :: OSI Approved :: BSD License"
24
+ ]
25
+ dependencies = [
26
+ "numpy",
27
+ "pandas",
28
+ "numba",
29
+ "tqdm",
30
+ "tensorstore",
31
+ "neuroglancer",
32
+ "requests",
33
+ ]
34
+ dynamic = ["version"]
35
+
36
+ [project.urls]
37
+ Homepage = "https://github.com/janelia-flyem/ngsidekick"
38
+ Repository = "https://github.com/janelia-flyem/ngsidekick"
39
+ Issues = "https://github.com/janelia-flyem/ngsidekick/issues"
40
+
41
+ [project.optional-dependencies]
42
+ test = ["pytest>=7"]
43
+ gcs = ["google-cloud-storage"]
44
+
45
+ [tool.hatch.version]
46
+ source = "vcs"
47
+
48
+ [tool.pytest.ini_options]
49
+ minversion = "7.0"
50
+ addopts = "-ra -q"
51
+ testpaths = ["tests"]
52
+
53
+ [tool.hatch.build.targets.wheel]
54
+ packages = ["src/ngsidekick"]
55
+ include = [
56
+ "src/ngsidekick/py.typed",
57
+ "LICENSE",
58
+ ]
59
+
60
+
@@ -0,0 +1,22 @@
1
+ """
2
+ neuroglancer-related utility functions
3
+ """
4
+ from importlib.metadata import version, PackageNotFoundError
5
+
6
+ try:
7
+ __version__ = version("ngsidekick")
8
+ except PackageNotFoundError:
9
+ # Package is not installed
10
+ __version__ = "unknown"
11
+
12
+ from .storage import download_ngstate, upload_ngstate, upload_ngstates, upload_json, upload_to_bucket, make_bucket_public
13
+ from .util import parse_nglink, format_nglink, layer_dict, layer_state
14
+ from .annotations.local import (
15
+ local_annotation_json, extract_local_annotations,
16
+
17
+ # deprecated names
18
+ extract_annotations, annotation_layer_json, point_annotation_layer_json
19
+ )
20
+ from .annotations.precomputed import write_precomputed_annotations
21
+ from .segmentprops import segment_properties_json, segment_properties_to_dataframe
22
+ from .segmentcolors import hex_string_from_segment_id