ossify 0.0.1__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 (88) hide show
  1. ossify-0.0.1/.bmv-post-commit.sh +2 -0
  2. ossify-0.0.1/.claude/settings.local.json +14 -0
  3. ossify-0.0.1/.github/workflows/mkdocs_publish.yml +29 -0
  4. ossify-0.0.1/.github/workflows/python-package.yml +31 -0
  5. ossify-0.0.1/.gitignore +113 -0
  6. ossify-0.0.1/.polyscope.ini +7 -0
  7. ossify-0.0.1/.pre-commit-config.yaml +13 -0
  8. ossify-0.0.1/864691135336055529.osy +0 -0
  9. ossify-0.0.1/CLAUDE.md +162 -0
  10. ossify-0.0.1/LICENSE +21 -0
  11. ossify-0.0.1/PKG-INFO +22 -0
  12. ossify-0.0.1/README.md +1 -0
  13. ossify-0.0.1/blah.png +0 -0
  14. ossify-0.0.1/cell_with_mesh.osy +0 -0
  15. ossify-0.0.1/doc_notebook.ipynb +155 -0
  16. ossify-0.0.1/docs/algorithms_and_analysis.md +495 -0
  17. ossify-0.0.1/docs/cell_object.md +372 -0
  18. ossify-0.0.1/docs/changelog.md +3 -0
  19. ossify-0.0.1/docs/data_import_export.md +501 -0
  20. ossify-0.0.1/docs/faq.md +410 -0
  21. ossify-0.0.1/docs/generate_example_plots.py +219 -0
  22. ossify-0.0.1/docs/generate_masking_plot.py +96 -0
  23. ossify-0.0.1/docs/getting_started.md +187 -0
  24. ossify-0.0.1/docs/images/advanced_masking_axon.png +0 -0
  25. ossify-0.0.1/docs/images/advanced_masking_dendrite.png +0 -0
  26. ossify-0.0.1/docs/images/basic_morphology.png +0 -0
  27. ossify-0.0.1/docs/images/masking_example.png +0 -0
  28. ossify-0.0.1/docs/images/multiview_plot.png +0 -0
  29. ossify-0.0.1/docs/images/publication_figure.png +0 -0
  30. ossify-0.0.1/docs/images/radius_visualization.png +0 -0
  31. ossify-0.0.1/docs/images/strahler_analysis.png +0 -0
  32. ossify-0.0.1/docs/img/quickstart_img.png +0 -0
  33. ossify-0.0.1/docs/index.md +93 -0
  34. ossify-0.0.1/docs/masking_and_filtering.md +438 -0
  35. ossify-0.0.1/docs/reference/algorithms.md +405 -0
  36. ossify-0.0.1/docs/reference/api.md +21 -0
  37. ossify-0.0.1/docs/reference/core.md +214 -0
  38. ossify-0.0.1/docs/reference/external.md +201 -0
  39. ossify-0.0.1/docs/reference/index.md +95 -0
  40. ossify-0.0.1/docs/reference/io.md +489 -0
  41. ossify-0.0.1/docs/reference/layers.md +335 -0
  42. ossify-0.0.1/docs/reference/plotting.md +601 -0
  43. ossify-0.0.1/docs/shared_layer_features.md +284 -0
  44. ossify-0.0.1/docs/stylesheets/extra.css +137 -0
  45. ossify-0.0.1/docs/visualization_and_plotting.md +595 -0
  46. ossify-0.0.1/docs/working_with_annotations.md +480 -0
  47. ossify-0.0.1/docs/working_with_graphs.md +344 -0
  48. ossify-0.0.1/docs/working_with_meshes.md +176 -0
  49. ossify-0.0.1/docs/working_with_skeletons.md +506 -0
  50. ossify-0.0.1/imgui.ini +19 -0
  51. ossify-0.0.1/mesh_labels.npy +0 -0
  52. ossify-0.0.1/mkdocs.yml +112 -0
  53. ossify-0.0.1/pyproject.toml +125 -0
  54. ossify-0.0.1/src/ossify/__init__.py +6 -0
  55. ossify-0.0.1/src/ossify/algorithms.py +514 -0
  56. ossify-0.0.1/src/ossify/base.py +1445 -0
  57. ossify-0.0.1/src/ossify/data_layers.py +2706 -0
  58. ossify-0.0.1/src/ossify/file_io.py +958 -0
  59. ossify-0.0.1/src/ossify/graph_functions.py +905 -0
  60. ossify-0.0.1/src/ossify/plot.py +1428 -0
  61. ossify-0.0.1/src/ossify/sync_classes.py +91 -0
  62. ossify-0.0.1/src/ossify/test.ipynb +472 -0
  63. ossify-0.0.1/src/ossify/translate.py +238 -0
  64. ossify-0.0.1/src/ossify/utils.py +252 -0
  65. ossify-0.0.1/test2.png +0 -0
  66. ossify-0.0.1/tests/conftest.py +186 -0
  67. ossify-0.0.1/tests/data/l2graph.json +1 -0
  68. ossify-0.0.1/tests/data/l2properties.feather +0 -0
  69. ossify-0.0.1/tests/data/post_l2.feather +0 -0
  70. ossify-0.0.1/tests/data/pre_l2.feather +0 -0
  71. ossify-0.0.1/tests/data/root_id.json +1 -0
  72. ossify-0.0.1/tests/data/skel.json +1 -0
  73. ossify-0.0.1/tests/data/test_cell_no_mesh.osy +0 -0
  74. ossify-0.0.1/tests/data/test_cell_with_mesh.osy +0 -0
  75. ossify-0.0.1/tests/data/test_meshwork.osy +0 -0
  76. ossify-0.0.1/tests/data/v1dd_864691132533489754.h5 +0 -0
  77. ossify-0.0.1/tests/test_algorithms.py +345 -0
  78. ossify-0.0.1/tests/test_algorithms_comprehensive.py +680 -0
  79. ossify-0.0.1/tests/test_base.py +773 -0
  80. ossify-0.0.1/tests/test_data_layers.py +893 -0
  81. ossify-0.0.1/tests/test_file_io.py +362 -0
  82. ossify-0.0.1/tests/test_plot.py +711 -0
  83. ossify-0.0.1/tests/test_sync_classes.py +486 -0
  84. ossify-0.0.1/tests/test_utils.py +155 -0
  85. ossify-0.0.1/uv.lock +4701 -0
  86. ossify-0.0.1/v1dd_types.ipynb +62 -0
  87. ossify-0.0.1/workflows/mkdocs_publish.yml +29 -0
  88. ossify-0.0.1/workflows/python-package.yml +31 -0
@@ -0,0 +1,2 @@
1
+ #!/bin/bash
2
+ git push --tags
@@ -0,0 +1,14 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Read(//Users/caseysm/Work/Code/morphsync/src/morphsync/**)",
5
+ "Bash(poe test:*)",
6
+ "Bash(python test_synapse_bug.py:*)",
7
+ "Bash(uv run pytest:*)",
8
+ "Bash(uv run mkdocs build:*)",
9
+ "Bash(uv run:*)"
10
+ ],
11
+ "deny": [],
12
+ "ask": []
13
+ }
14
+ }
@@ -0,0 +1,29 @@
1
+ name: mkdocs
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ - main
7
+ permissions:
8
+ contents: write
9
+ jobs:
10
+ deploy:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - name: Configure Git Credentials
15
+ run: |
16
+ git config user.name github-actions[bot]
17
+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: 3.x
21
+ - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
22
+ - uses: actions/cache@v4
23
+ with:
24
+ key: mkdocs-material-${{ env.cache_id }}
25
+ path: .cache
26
+ restore-keys: |
27
+ mkdocs-material-
28
+ - run: pip install mkdocs-material mkdocstrings[python]
29
+ - run: mkdocs gh-deploy --force
@@ -0,0 +1,31 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Python test and lint
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+
12
+ jobs:
13
+ build:
14
+ name: python
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ python-version: ["3.11", "3.12"]
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v2
24
+ with:
25
+ version: "0.5.2"
26
+ - name: Install project and dependencies
27
+ run: uv sync --python ${{ matrix.python-version }}
28
+ - name: Run tests
29
+ run: uv run pytest tests
30
+ - name: Lint with ruff
31
+ run: uv run ruff check src/*
@@ -0,0 +1,113 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ scratch.ipynb
6
+
7
+ # C extensions
8
+ *.so
9
+
10
+ # Distribution / packaging
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ 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
+ .coverage
43
+ .coverage.*
44
+ .cache
45
+ nosetests.xml
46
+ coverage.xml
47
+ *.cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+
51
+ # Translations
52
+ *.mo
53
+ *.pot
54
+
55
+ # Django stuff:
56
+ *.log
57
+ local_settings.py
58
+ db.sqlite3
59
+
60
+ # Flask stuff:
61
+ instance/
62
+ .webassets-cache
63
+
64
+ # Scrapy stuff:
65
+ .scrapy
66
+
67
+ # Sphinx documentation
68
+ docs/_build/
69
+
70
+ # PyBuilder
71
+ target/
72
+
73
+ # Jupyter Notebook
74
+ .ipynb_checkpoints
75
+
76
+ # pyenv
77
+ .python-version
78
+
79
+ # celery beat schedule file
80
+ celerybeat-schedule
81
+
82
+ # SageMath parsed files
83
+ *.sage.py
84
+
85
+ # Environments
86
+ .env
87
+ .venv
88
+ env/
89
+ venv/
90
+ ENV/
91
+ env.bak/
92
+ venv.bak/
93
+
94
+ # Spyder project settings
95
+ .spyderproject
96
+ .spyproject
97
+
98
+ # Rope project settings
99
+ .ropeproject
100
+
101
+ # mkdocs documentation
102
+ /site
103
+
104
+ # mypy
105
+ .mypy_cache/
106
+
107
+ .DS_Store
108
+ test-reports/
109
+ var/
110
+ .vscode
111
+ *.orig
112
+ *.sublime-workspace
113
+
@@ -0,0 +1,7 @@
1
+ {
2
+ "uiScale": 1.0,
3
+ "windowHeight": 1023,
4
+ "windowPosX": 20,
5
+ "windowPosY": 72,
6
+ "windowWidth": 1601
7
+ }
@@ -0,0 +1,13 @@
1
+ files: src|tests
2
+
3
+ repos:
4
+ - repo: https://github.com/astral-sh/ruff-pre-commit
5
+ rev: v0.11.2
6
+ hooks:
7
+ # Run the linter.
8
+ - id: ruff
9
+ types_or: [ python, pyi]
10
+ - id: ruff
11
+ args: ["--select", "I", "--fix"]
12
+ - id: ruff-format
13
+ types_or: [ python, pyi]
Binary file
ossify-0.0.1/CLAUDE.md ADDED
@@ -0,0 +1,162 @@
1
+ # ossify Development Guide
2
+
3
+ This guide documents the development workflow, testing strategies, and coding standards for ossify.
4
+
5
+ ## Development Environment
6
+
7
+ ### Package Management: UV + Poe
8
+
9
+ This project uses **UV** for dependency management and **Poe** for task running instead of the system Python environment:
10
+
11
+ ```bash
12
+ # Install dependencies (automatically creates virtual environment)
13
+ uv sync
14
+
15
+ # Run tasks via Poe (preferred over direct python commands)
16
+ poe test # Run tests with coverage
17
+ poe doc-preview # Preview documentation
18
+ poe bump patch # Bump version (patch/minor/major)
19
+ poe drybump patch # Dry run version bump
20
+ ```
21
+
22
+ ### Key Commands
23
+
24
+ From `pyproject.toml`:
25
+
26
+ - **Testing**: `poe test` → `uv run pytest --cov=ossify tests`
27
+ - **Documentation**: `poe doc-preview` → `uv run mkdocs serve`
28
+ - **Version Management**: `poe bump patch/minor/major`
29
+ - **Linting**: `uv run ruff check src/ tests/`
30
+
31
+ ## Python Version Requirements
32
+
33
+ - **Minimum**: Python 3.10+ (leverages match statements and improved type annotations)
34
+ - **Tested**: Python 3.10, 3.11, 3.12
35
+ - **Compatibility**: Use `typing-extensions` for Python < 3.11 features
36
+
37
+ ## Type Hinting Standards
38
+
39
+ ### Required Practices
40
+
41
+ - **All functions/methods** must have complete type annotations
42
+ - **All class attributes** must have type hints (use `attrs` or `dataclasses` with type annotations).
43
+ - **Import patterns**:
44
+ ```python
45
+ from typing import Optional, Union, Literal, Any, Dict, List, Tuple
46
+ from typing_extensions import Self # For Python < 3.11
47
+ ```
48
+ - **All python files**: Follow ruff guidelines for linting, imports, and code style.
49
+
50
+ ### Common Patterns
51
+
52
+ ## Testing Strategy
53
+
54
+ ### Dual-Level Testing Approach
55
+
56
+ Always implement **both** high-level integration tests and low-level unit tests:
57
+
58
+ #### High-Level Integration Tests
59
+ Focus on real-world workflows and end-to-end functionality:
60
+
61
+ #### Low-Level Unit Tests
62
+ Focus on individual methods, edge cases, and error conditions:
63
+
64
+ ### Testing Guidelines
65
+
66
+ - **Coverage Target**: Aim for >90% line coverage, >85% branch coverage
67
+ - **Test Organization**: Mirror source structure in `tests/` directory
68
+ - **Mocking Strategy**: Mock external dependencies (neuroglancer), test actual behavior for internal logic
69
+ - **Parametrization**: Use `@pytest.mark.parametrize` for testing multiple inputs
70
+ - **Fixtures**: Create reusable test data in `conftest.py`
71
+
72
+ ### Running Tests
73
+
74
+ ```bash
75
+ # Full test suite with coverage
76
+ poe test
77
+
78
+ # Specific test file
79
+ uv run pytest tests/EXAMPLE_TEST_FILE.py -v
80
+
81
+ # Coverage report
82
+ uv run pytest --cov=ossify --cov-report=html tests/
83
+ ```
84
+
85
+ ## Code Architecture Patterns
86
+
87
+ ## Common Development Workflows
88
+
89
+ ### Bug Fixes
90
+
91
+ 1. Write failing test first (TDD approach)
92
+ 2. Describe problem fully to determine whether the behavior is a bug, intentional, or based on unspecified assumptions.
93
+ 3. Implement minimal fix
94
+ 4. Ensure all tests pass
95
+ 5. Check type annotations are correct
96
+ 6. Run full test suite: `poe test`
97
+
98
+ ## Documentation Standards
99
+
100
+ - **Docstrings**: Use Google/NumPy style docstrings
101
+ - **Examples**: Include usage examples in docstrings
102
+ - **Type Information**: Document parameter and return types in docstrings
103
+ - **API Documentation**: Use mkdocs with mkdocstrings for auto-generation
104
+
105
+ ```python
106
+ def add_points(
107
+ self,
108
+ data: pd.DataFrame,
109
+ point_column: Union[str, List[str]],
110
+ segment_column: Optional[str] = None
111
+ ) -> Self:
112
+ """Add point annotations to the viewer state.
113
+
114
+ Args:
115
+ data: DataFrame containing point data
116
+ point_column: Column name(s) for coordinates. Can be:
117
+ - Single string for prefix (e.g., 'pos' → ['pos_x', 'pos_y', 'pos_z'])
118
+ - List of column names (e.g., ['x', 'y', 'z'])
119
+ segment_column: Optional column containing segment IDs
120
+
121
+ Returns:
122
+ Self for method chaining
123
+
124
+ Examples:
125
+ >>> vs = ViewerState()
126
+ >>> vs.add_points(df, point_column=['x', 'y', 'z'])
127
+ >>> vs.add_points(df, point_column='position') # Uses position_x, position_y, position_z
128
+ """
129
+ ```
130
+
131
+ ## Pre-Commit Workflow
132
+
133
+ Before committing changes:
134
+
135
+ ```bash
136
+ # Run full test suite
137
+ poe test
138
+
139
+ # Run linting
140
+ uv run ruff check src/ tests/
141
+
142
+ # Check type annotations
143
+ uv run mypy src/ --ignore-missing-imports # if mypy is configured
144
+
145
+ # Ensure documentation builds
146
+ poe doc-preview
147
+ ```
148
+
149
+ ## Release Process
150
+
151
+ ```bash
152
+ # Check what will be bumped
153
+ poe drybump patch # or minor/major
154
+
155
+ # Bump version and create tag
156
+ poe bump patch # or minor/major
157
+ ```
158
+
159
+ This automatically:
160
+ - Updates version in `pyproject.toml` and `src/ossify/__init__.py`
161
+ - Creates git commit and tag
162
+ - Runs pre/post commit hooks including `uv sync`
ossify-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Casey Schneider-Mizell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
ossify-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: ossify
3
+ Version: 0.0.1
4
+ Summary: Mesh and skeleton analysis
5
+ Author-email: Casey Schneider-Mizell <caseysm@gmail.com>
6
+ License-File: LICENSE
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Requires-Python: >=3.11
9
+ Requires-Dist: caveclient>=7.6.0
10
+ Requires-Dist: cloud-files>=5.8.0
11
+ Requires-Dist: cloud-volume>=11.1.5
12
+ Requires-Dist: matplotlib>=3.10.6
13
+ Requires-Dist: morphsync==0.1.0
14
+ Requires-Dist: numpy>=2.0.2
15
+ Requires-Dist: orjson>=3.10.15
16
+ Requires-Dist: scipy>=1.15
17
+ Requires-Dist: trimesh[easy]>=4.6.2
18
+ Provides-Extra: legacy
19
+ Requires-Dist: h5py>=3.14.0; extra == 'legacy'
20
+ Description-Content-Type: text/markdown
21
+
22
+ Welcome to ossify!
ossify-0.0.1/README.md ADDED
@@ -0,0 +1 @@
1
+ Welcome to ossify!
ossify-0.0.1/blah.png ADDED
Binary file
Binary file