wsidata 0.1.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 (59) hide show
  1. wsidata-0.1.0/.github/workflows/build.yaml +87 -0
  2. wsidata-0.1.0/.gitignore +168 -0
  3. wsidata-0.1.0/.pre-commit-config.yaml +10 -0
  4. wsidata-0.1.0/.readthedocs.yaml +17 -0
  5. wsidata-0.1.0/PKG-INFO +43 -0
  6. wsidata-0.1.0/README.md +17 -0
  7. wsidata-0.1.0/assets/logo.ai +6262 -27
  8. wsidata-0.1.0/assets/logo.svg +231 -0
  9. wsidata-0.1.0/assets/logo.webp +0 -0
  10. wsidata-0.1.0/assets/logo@3x.png +0 -0
  11. wsidata-0.1.0/docs/Makefile +24 -0
  12. wsidata-0.1.0/docs/make.bat +35 -0
  13. wsidata-0.1.0/docs/source/_static/custom.css +47 -0
  14. wsidata-0.1.0/docs/source/_static/logo.svg +231 -0
  15. wsidata-0.1.0/docs/source/_templates/autosummary.rst +15 -0
  16. wsidata-0.1.0/docs/source/api/.gitignore +1 -0
  17. wsidata-0.1.0/docs/source/api/index.rst +67 -0
  18. wsidata-0.1.0/docs/source/conf.py +76 -0
  19. wsidata-0.1.0/docs/source/index.rst +58 -0
  20. wsidata-0.1.0/docs/source/installation.rst +112 -0
  21. wsidata-0.1.0/docs/source/intro/.gitignore +1 -0
  22. wsidata-0.1.0/docs/source/intro/01-read&write.ipynb +163 -0
  23. wsidata-0.1.0/docs/source/intro/02-accessors.ipynb +225 -0
  24. wsidata-0.1.0/docs/source/intro/index.rst +29 -0
  25. wsidata-0.1.0/pyproject.toml +46 -0
  26. wsidata-0.1.0/tests/conftest.py +15 -0
  27. wsidata-0.1.0/tests/test_accessors.py +57 -0
  28. wsidata-0.1.0/tests/test_read_wsi.py +11 -0
  29. wsidata-0.1.0/tests/test_readers.py +47 -0
  30. wsidata-0.1.0/tests/test_wsidata.py +84 -0
  31. wsidata-0.1.0/wsidata/__init__.py +14 -0
  32. wsidata-0.1.0/wsidata/_accessors/__init__.py +4 -0
  33. wsidata-0.1.0/wsidata/_accessors/dataset.py +79 -0
  34. wsidata-0.1.0/wsidata/_accessors/get.py +150 -0
  35. wsidata-0.1.0/wsidata/_accessors/iter.py +365 -0
  36. wsidata-0.1.0/wsidata/_accessors/register.py +87 -0
  37. wsidata-0.1.0/wsidata/_const.py +0 -0
  38. wsidata-0.1.0/wsidata/_io/__init__.py +1 -0
  39. wsidata-0.1.0/wsidata/_io/_image.py +48 -0
  40. wsidata-0.1.0/wsidata/_io/_store.py +174 -0
  41. wsidata-0.1.0/wsidata/_io/download.py +127 -0
  42. wsidata-0.1.0/wsidata/_io/wsi.py +277 -0
  43. wsidata-0.1.0/wsidata/_model/__init__.py +2 -0
  44. wsidata-0.1.0/wsidata/_model/data.py +423 -0
  45. wsidata-0.1.0/wsidata/_model/tilespec.py +52 -0
  46. wsidata-0.1.0/wsidata/_normalizer.py +47 -0
  47. wsidata-0.1.0/wsidata/_utils.py +34 -0
  48. wsidata-0.1.0/wsidata/dataset/__init__.py +5 -0
  49. wsidata-0.1.0/wsidata/dataset/disk.py +2 -0
  50. wsidata-0.1.0/wsidata/dataset/feature.py +48 -0
  51. wsidata-0.1.0/wsidata/dataset/graph.py +13 -0
  52. wsidata-0.1.0/wsidata/dataset/image.py +96 -0
  53. wsidata-0.1.0/wsidata/reader/__init__.py +6 -0
  54. wsidata-0.1.0/wsidata/reader/base.py +318 -0
  55. wsidata-0.1.0/wsidata/reader/bioformats.py +263 -0
  56. wsidata-0.1.0/wsidata/reader/cucim.py +70 -0
  57. wsidata-0.1.0/wsidata/reader/openslide.py +74 -0
  58. wsidata-0.1.0/wsidata/reader/tiffslide.py +22 -0
  59. wsidata-0.1.0/wsidata/reader/utils.py +142 -0
@@ -0,0 +1,87 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ paths:
6
+ - '.github/**'
7
+ - 'wsidata/**'
8
+ - 'tests/**'
9
+ - 'pyproject.toml'
10
+ pull_request:
11
+ paths:
12
+ - '.github/**'
13
+ - 'wsidata/**'
14
+ - 'tests/**'
15
+ - 'pyproject.toml'
16
+
17
+ jobs:
18
+ Test:
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ os: [ubuntu-latest, windows-latest, macos-latest]
23
+ python-version: ['3.9', '3.10', '3.11', '3.12']
24
+
25
+ runs-on: ${{ matrix.os }}
26
+ defaults:
27
+ run:
28
+ shell: bash -el {0}
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - name: Setup Miniconda
32
+ uses: conda-incubator/setup-miniconda@v3.0.4
33
+ with:
34
+ activate-environment: test-env
35
+ python-version: ${{ matrix.python-version }}
36
+ - name: Test project installation
37
+ run: |
38
+ python -m pip install --upgrade pip
39
+ pip install .[all,dev]
40
+ pip install torch torchstain
41
+ - name: Install OpenSlide
42
+ if: matrix.os != 'windows-latest'
43
+ run: |
44
+ conda install -c conda-forge openslide-python
45
+ - name: Install scyjava
46
+ run: |
47
+ conda install -c conda-forge scyjava
48
+ - name: Test with pytest
49
+ run: |
50
+ pip install pytest
51
+ pytest tests/
52
+
53
+ Upload_to_pypi:
54
+ runs-on: ubuntu-latest
55
+ steps:
56
+ - uses: actions/checkout@v4
57
+ - name: Set up Python
58
+ uses: actions/setup-python@v4
59
+ with:
60
+ python-version: '3.12'
61
+
62
+ - name: Install dependencies
63
+ run: |
64
+ python -m pip install --upgrade pip
65
+ pip install .
66
+
67
+ - name: Install Hatch
68
+ uses: pypa/hatch@install
69
+
70
+ - name: Publish to test pypi
71
+ env:
72
+ HATCH_INDEX_REPO: https://test.pypi.org/legacy/
73
+ HATCH_INDEX_USER: __token__
74
+ HATCH_INDEX_AUTH: ${{ secrets.PYPI_TEST_TOKEN }}
75
+ run: |
76
+ hatch build
77
+ hatch publish || exit 0
78
+
79
+ - name: Publish to pypi
80
+ if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
81
+ env:
82
+ HATCH_INDEX_REPO: https://upload.pypi.org/legacy/
83
+ HATCH_INDEX_USER: __token__
84
+ HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
85
+ run: |
86
+ hatch build
87
+ hatch publish
@@ -0,0 +1,168 @@
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
+ # Ruff cache
156
+ .ruff_cache/
157
+
158
+ # PyCharm
159
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
160
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
161
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
162
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
163
+ .idea/
164
+ .DS_Store
165
+
166
+ data/
167
+ work/
168
+ .nextflow.log*
@@ -0,0 +1,10 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ # Ruff version.
4
+ rev: v0.6.5
5
+ hooks:
6
+ # Run the linter.
7
+ - id: ruff
8
+ args: [ --fix ]
9
+ # Run the formatter.
10
+ - id: ruff-format
@@ -0,0 +1,17 @@
1
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
2
+ version: 2
3
+
4
+ build:
5
+ os: ubuntu-22.04
6
+ tools:
7
+ python: "3.12"
8
+
9
+ sphinx:
10
+ configuration: docs/source/conf.py
11
+
12
+ python:
13
+ install:
14
+ - method: pip
15
+ path: .
16
+ extra_requirements:
17
+ - dev
wsidata-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,43 @@
1
+ Metadata-Version: 2.3
2
+ Name: wsidata
3
+ Version: 0.1.0
4
+ Dynamic: Summary
5
+ Classifier: License :: OSI Approved :: MIT License
6
+ Requires-Python: >=3.7
7
+ Requires-Dist: opencv-python
8
+ Requires-Dist: openslide-python
9
+ Requires-Dist: rich
10
+ Requires-Dist: spatialdata>=0.2.2
11
+ Requires-Dist: tiffslide
12
+ Provides-Extra: all
13
+ Requires-Dist: torch; extra == 'all'
14
+ Requires-Dist: torchstain; extra == 'all'
15
+ Requires-Dist: torchvision; extra == 'all'
16
+ Provides-Extra: dev
17
+ Requires-Dist: hatchling; extra == 'dev'
18
+ Requires-Dist: myst-nb; extra == 'dev'
19
+ Requires-Dist: numpydoc; extra == 'dev'
20
+ Requires-Dist: pydata-sphinx-theme; extra == 'dev'
21
+ Requires-Dist: pytest; extra == 'dev'
22
+ Requires-Dist: sphinx; extra == 'dev'
23
+ Requires-Dist: sphinx-copybutton; extra == 'dev'
24
+ Requires-Dist: sphinx-design; extra == 'dev'
25
+ Description-Content-Type: text/markdown
26
+
27
+ # wsidata
28
+
29
+ <p align="center">
30
+ <picture align="center">
31
+ <img src="https://raw.githubusercontent.com/rendeirolab/wsidata/main/assets/logo.svg" width="100px">
32
+ </picture>
33
+ </p>
34
+ <p align="center">
35
+ <i>Efficient data structures and IO for whole slide images analysis</i>
36
+ </p>
37
+
38
+
39
+ ## Installation
40
+
41
+ ```bash
42
+ pip install wsidata
43
+ ```
@@ -0,0 +1,17 @@
1
+ # wsidata
2
+
3
+ <p align="center">
4
+ <picture align="center">
5
+ <img src="https://raw.githubusercontent.com/rendeirolab/wsidata/main/assets/logo.svg" width="100px">
6
+ </picture>
7
+ </p>
8
+ <p align="center">
9
+ <i>Efficient data structures and IO for whole slide images analysis</i>
10
+ </p>
11
+
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ pip install wsidata
17
+ ```