inflexa-mdvtools 1.3.0.post1__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 (130) hide show
  1. inflexa_mdvtools-1.3.0.post1/PKG-INFO +128 -0
  2. inflexa_mdvtools-1.3.0.post1/PYPI_README.md +68 -0
  3. inflexa_mdvtools-1.3.0.post1/mdvtools/__init__.py +20 -0
  4. inflexa_mdvtools-1.3.0.post1/mdvtools/_optional.py +45 -0
  5. inflexa_mdvtools-1.3.0.post1/mdvtools/auth/__init__.py +0 -0
  6. inflexa_mdvtools-1.3.0.post1/mdvtools/auth/auth0_provider.py +779 -0
  7. inflexa_mdvtools-1.3.0.post1/mdvtools/auth/auth_invitation +217 -0
  8. inflexa_mdvtools-1.3.0.post1/mdvtools/auth/auth_provider.py +44 -0
  9. inflexa_mdvtools-1.3.0.post1/mdvtools/auth/authutils.py +290 -0
  10. inflexa_mdvtools-1.3.0.post1/mdvtools/auth/dummy_provider.py +60 -0
  11. inflexa_mdvtools-1.3.0.post1/mdvtools/auth/project_auth.py +83 -0
  12. inflexa_mdvtools-1.3.0.post1/mdvtools/auth/register_auth_routes.py +139 -0
  13. inflexa_mdvtools-1.3.0.post1/mdvtools/auth/shibboleth_provider.py +126 -0
  14. inflexa_mdvtools-1.3.0.post1/mdvtools/benchmarking/memory.py +18 -0
  15. inflexa_mdvtools-1.3.0.post1/mdvtools/build_info.py +195 -0
  16. inflexa_mdvtools-1.3.0.post1/mdvtools/chart_prototypes.py +283 -0
  17. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/abundance_box_plot.py +35 -0
  18. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/base_plot.py +36 -0
  19. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/box_plot.py +43 -0
  20. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/density_scatter_plot.py +38 -0
  21. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/dot_plot.py +22 -0
  22. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/heatmap_plot.py +47 -0
  23. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/histogram_plot.py +36 -0
  24. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/multi_line_plot.py +37 -0
  25. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/pie_chart.py +37 -0
  26. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/ring_chart.py +37 -0
  27. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/row_chart.py +13 -0
  28. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/row_summary_box_plot.py +5 -0
  29. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/sankey_plot.py +9 -0
  30. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/scatter_plot.py +40 -0
  31. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/scatter_plot_3D.py +73 -0
  32. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/selection_dialog_plot.py +8 -0
  33. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/stacked_row_plot.py +16 -0
  34. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/table_plot.py +18 -0
  35. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/text_box_plot.py +8 -0
  36. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/view.py +25 -0
  37. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/violin_plot.py +37 -0
  38. inflexa_mdvtools-1.3.0.post1/mdvtools/charts/wordcloud_plot.py +17 -0
  39. inflexa_mdvtools-1.3.0.post1/mdvtools/cli.py +218 -0
  40. inflexa_mdvtools-1.3.0.post1/mdvtools/conversions.py +1660 -0
  41. inflexa_mdvtools-1.3.0.post1/mdvtools/convert_anndata.py +63 -0
  42. inflexa_mdvtools-1.3.0.post1/mdvtools/csv_to_static.py +268 -0
  43. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/CLEANUP_SCRIPT_README.md +273 -0
  44. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/__init__.py +0 -0
  45. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/cleanup_projects.py +1040 -0
  46. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/config.json +8 -0
  47. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/dbmodels.py +185 -0
  48. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/dbservice.py +970 -0
  49. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/emptyds.csv +2 -0
  50. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/mdv_server_app.py +611 -0
  51. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/project_manager_extension.py +820 -0
  52. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/project_manager_service.py +66 -0
  53. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/routes.py +223 -0
  54. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/safe_mdv_app.py +70 -0
  55. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/server_options.py +35 -0
  56. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/test/__init__.py +0 -0
  57. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/test/integration/__init__.py +0 -0
  58. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/test/unit/__init__.py +0 -0
  59. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/test/unit/test_mdv_server_app.py +742 -0
  60. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/test/unit/test_project_recycle_bin.py +221 -0
  61. inflexa_mdvtools-1.3.0.post1/mdvtools/dbutils/validation_rules.json +10 -0
  62. inflexa_mdvtools-1.3.0.post1/mdvtools/examples/README.md +40 -0
  63. inflexa_mdvtools-1.3.0.post1/mdvtools/examples/flexible_network_example.py +236 -0
  64. inflexa_mdvtools-1.3.0.post1/mdvtools/examples/ligand_network_example.py +232 -0
  65. inflexa_mdvtools-1.3.0.post1/mdvtools/file_processing.py +504 -0
  66. inflexa_mdvtools-1.3.0.post1/mdvtools/image_view_prototype.py +103 -0
  67. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/CHATMDV_BOUNDARY.md +62 -0
  68. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/CHATMDV_PRD.md +261 -0
  69. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/chat_cli.py +468 -0
  70. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/chat_client_refresh.py +17 -0
  71. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/chat_preview.py +55 -0
  72. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/chat_protocol.py +76 -0
  73. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/chat_server_extension.py +196 -0
  74. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/chatlog.py +350 -0
  75. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/check_chatmdv_boundary.py +122 -0
  76. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/code_execution.py +209 -0
  77. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/code_files_URL.txt +13 -0
  78. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/code_manipulation.py +290 -0
  79. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/code_preflight.py +667 -0
  80. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/column_field_resolve.py +373 -0
  81. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/datasource_roles.py +481 -0
  82. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/execution_progress.py +218 -0
  83. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/github_utils.py +140 -0
  84. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/langchain_mdv.py +968 -0
  85. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/local_files_utils.py +80 -0
  86. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/preflight_flow.py +49 -0
  87. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/templates.py +367 -0
  88. inflexa_mdvtools-1.3.0.post1/mdvtools/llm/verification.py +333 -0
  89. inflexa_mdvtools-1.3.0.post1/mdvtools/logging_config.py +50 -0
  90. inflexa_mdvtools-1.3.0.post1/mdvtools/markdown_utils.py +189 -0
  91. inflexa_mdvtools-1.3.0.post1/mdvtools/mdv_desktop.py +140 -0
  92. inflexa_mdvtools-1.3.0.post1/mdvtools/mdvproject.py +2942 -0
  93. inflexa_mdvtools-1.3.0.post1/mdvtools/network_helpers.py +403 -0
  94. inflexa_mdvtools-1.3.0.post1/mdvtools/project_protocols.py +36 -0
  95. inflexa_mdvtools-1.3.0.post1/mdvtools/project_router.py +269 -0
  96. inflexa_mdvtools-1.3.0.post1/mdvtools/querytools/__init__.py +0 -0
  97. inflexa_mdvtools-1.3.0.post1/mdvtools/querytools/app.py +84 -0
  98. inflexa_mdvtools-1.3.0.post1/mdvtools/querytools/index.html +126 -0
  99. inflexa_mdvtools-1.3.0.post1/mdvtools/requirements.txt +11 -0
  100. inflexa_mdvtools-1.3.0.post1/mdvtools/scripts/manage_project_permissions.py +217 -0
  101. inflexa_mdvtools-1.3.0.post1/mdvtools/server.py +736 -0
  102. inflexa_mdvtools-1.3.0.post1/mdvtools/server_extension.py +55 -0
  103. inflexa_mdvtools-1.3.0.post1/mdvtools/server_utils.py +95 -0
  104. inflexa_mdvtools-1.3.0.post1/mdvtools/serverlite.py +196 -0
  105. inflexa_mdvtools-1.3.0.post1/mdvtools/socketio_upload.py +1039 -0
  106. inflexa_mdvtools-1.3.0.post1/mdvtools/spatial/__init__.py +0 -0
  107. inflexa_mdvtools-1.3.0.post1/mdvtools/spatial/annotations.py +482 -0
  108. inflexa_mdvtools-1.3.0.post1/mdvtools/spatial/conversion.py +1268 -0
  109. inflexa_mdvtools-1.3.0.post1/mdvtools/spatial/conversion_report.py +494 -0
  110. inflexa_mdvtools-1.3.0.post1/mdvtools/spatial/jp2k.py +34 -0
  111. inflexa_mdvtools-1.3.0.post1/mdvtools/spatial/mermaid.py +81 -0
  112. inflexa_mdvtools-1.3.0.post1/mdvtools/spatial/mock_spatialdata.py +7 -0
  113. inflexa_mdvtools-1.3.0.post1/mdvtools/spatial/project_helpers.py +112 -0
  114. inflexa_mdvtools-1.3.0.post1/mdvtools/spatial/spatial_regions_xenium_prototype.json +28 -0
  115. inflexa_mdvtools-1.3.0.post1/mdvtools/spatial/spatial_view_template.json +142 -0
  116. inflexa_mdvtools-1.3.0.post1/mdvtools/spatial/xenium.py +449 -0
  117. inflexa_mdvtools-1.3.0.post1/mdvtools/spatial.py +165 -0
  118. inflexa_mdvtools-1.3.0.post1/mdvtools/stress_tests/README.md +171 -0
  119. inflexa_mdvtools-1.3.0.post1/mdvtools/stress_tests/test_json_write.py +263 -0
  120. inflexa_mdvtools-1.3.0.post1/mdvtools/templates/index.html +12 -0
  121. inflexa_mdvtools-1.3.0.post1/mdvtools/templates/login.html +11 -0
  122. inflexa_mdvtools-1.3.0.post1/mdvtools/templates/page.html +31 -0
  123. inflexa_mdvtools-1.3.0.post1/mdvtools/templates/serviceworker.js +115 -0
  124. inflexa_mdvtools-1.3.0.post1/mdvtools/templates/static_page.html +25 -0
  125. inflexa_mdvtools-1.3.0.post1/mdvtools/templates/tracks/hg38.bed.gz +0 -0
  126. inflexa_mdvtools-1.3.0.post1/mdvtools/templates/tracks/hg38.bed.gz.tbi +0 -0
  127. inflexa_mdvtools-1.3.0.post1/mdvtools/templates/views/capsequm.json +145 -0
  128. inflexa_mdvtools-1.3.0.post1/mdvtools/templates/views/regulamentary.json +119 -0
  129. inflexa_mdvtools-1.3.0.post1/mdvtools/websocket.py +62 -0
  130. inflexa_mdvtools-1.3.0.post1/pyproject.toml +170 -0
@@ -0,0 +1,128 @@
1
+ Metadata-Version: 2.4
2
+ Name: inflexa-mdvtools
3
+ Version: 1.3.0.post1
4
+ Summary: Multi Dimensional Viewer (MDV) is web based application for analyzing data
5
+ Author: Martin Sergeant, PeterTodd
6
+ Author-email: Martin Sergeant <m.j.sergeant1@googlemail.com>, PeterTodd <peter.todd@well.ox.ac.uk>
7
+ License-Expression: GPL-3.0-only
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Requires-Dist: anndata>=0.12.2,<0.14
13
+ Requires-Dist: fasteners>=0.18,<0.19
14
+ Requires-Dist: flask>=2.2.5,<4
15
+ Requires-Dist: flask-socketio>=5.3.6,<6
16
+ Requires-Dist: h5py>=3.10.0,<4
17
+ Requires-Dist: mudata>=0.3.0
18
+ Requires-Dist: numpy>=2,<2.6
19
+ Requires-Dist: numcodecs>=0.16.1
20
+ Requires-Dist: pandas>=2.3.2,<3
21
+ Requires-Dist: scanpy>=1.11.4,<1.13
22
+ Requires-Dist: scipy>=1.11.3,<2
23
+ Requires-Dist: werkzeug>=3.0.2,<4
24
+ Requires-Dist: gevent>=25.5.1,<26
25
+ Requires-Dist: polars>=1.31.0,<2
26
+ Requires-Dist: spatialdata>=0.7.2,<0.9
27
+ Requires-Dist: spatialdata-io>=0.6.0,<0.8
28
+ Requires-Dist: generate-tiff-offsets>=0.1.7,<0.2
29
+ Requires-Dist: inflexa-mdvtools[app] ; extra == 'all'
30
+ Requires-Dist: flask-sqlalchemy>=3.1.1,<4 ; extra == 'app'
31
+ Requires-Dist: psycopg2-binary>=2.9.9,<3 ; extra == 'app'
32
+ Requires-Dist: gunicorn==23.0.0 ; extra == 'app'
33
+ Requires-Dist: psycogreen>=1.0.2,<2 ; extra == 'app'
34
+ Requires-Dist: langchain>=0.3.27,<0.4 ; extra == 'app'
35
+ Requires-Dist: langchain-experimental>=0.3.4,<0.4 ; extra == 'app'
36
+ Requires-Dist: langchain-openai>=0.3.33,<0.4 ; extra == 'app'
37
+ Requires-Dist: langchain-community>=0.3,<0.4 ; extra == 'app'
38
+ Requires-Dist: faiss-cpu==1.12.0 ; extra == 'app'
39
+ Requires-Dist: matplotlib>=3.8.4,<4 ; extra == 'app'
40
+ Requires-Dist: regex>=2024.5.15,<2025 ; extra == 'app'
41
+ Requires-Dist: python-dotenv>=1.0.1,<2 ; extra == 'app'
42
+ Requires-Dist: nbformat>=5.10.4,<6 ; extra == 'app'
43
+ Requires-Dist: tabulate>=0.9.0,<0.10 ; extra == 'app'
44
+ Requires-Dist: ruff>=0.3.7,<0.4 ; extra == 'app'
45
+ Requires-Dist: gspread>=6.1.2,<7 ; extra == 'app'
46
+ Requires-Dist: oauth2client>=4.1.3,<5 ; extra == 'app'
47
+ Requires-Dist: authlib==1.6.4 ; extra == 'app'
48
+ Requires-Dist: requests>=2.32.3,<3 ; extra == 'app'
49
+ Requires-Dist: python-jose>=3.3.0,<4 ; extra == 'app'
50
+ Requires-Dist: auth0-python>=4.9.0,<5 ; extra == 'app'
51
+ Requires-Dist: flask-jwt-extended>=4.7.1,<5 ; extra == 'app'
52
+ Requires-Dist: redis>=5.2.1,<6 ; extra == 'app'
53
+ Requires-Python: >=3.11, <3.13
54
+ Project-URL: Homepage, https://github.com/inflexa-ai/MDV
55
+ Project-URL: Bug Tracker, https://github.com/inflexa-ai/MDV/issues
56
+ Project-URL: Upstream, https://github.com/Taylor-CCB-Group/MDV
57
+ Provides-Extra: all
58
+ Provides-Extra: app
59
+ Description-Content-Type: text/markdown
60
+
61
+ # inflexa-mdvtools
62
+
63
+ `inflexa-mdvtools` is a fork of `mdvtools` 1.3.0, the Python package of the Multi-Dimensional Viewer (MDV).
64
+ The fork changes the dependency pins of `mdvtools` to version ranges.
65
+ These ranges include the package versions of the Inflexa package store, for example anndata 0.13, spatialdata 0.8, and numpy 2.5.
66
+ The fork also has the code changes that make the conversions work on these versions.
67
+ The import name stays `mdvtools`.
68
+
69
+ - Fork source: https://github.com/inflexa-ai/MDV (branch `inflexa`)
70
+ - Upstream: https://github.com/Taylor-CCB-Group/MDV (tag `v1.3.0`)
71
+
72
+ Do not install `inflexa-mdvtools` and `mdvtools` in the same environment, because each package gives the `mdvtools` module.
73
+
74
+ ## About MDV Tools
75
+
76
+ **Multi-Dimensional Viewer (MDV)** is a web-based application for analysing and visualising
77
+ large, multi-dimensional data (single-cell, spatial, and general tabular data). `mdvtools`
78
+ is the Python package for **creating, manipulating, and viewing MDV projects** — including a
79
+ lightweight local server and the ability to export a project as a static website.
80
+
81
+ ## Installation
82
+
83
+ ```bash
84
+ pip install inflexa-mdvtools
85
+ ```
86
+
87
+ This installs the **slim core**: everything you need to build, manipulate, view, and serve
88
+ MDV projects, including spatial-data support.
89
+
90
+ For the **full application** — database-backed project management, the chat/LLM assistant,
91
+ and authentication — install the `app` extra:
92
+
93
+ ```bash
94
+ pip install "inflexa-mdvtools[app]"
95
+ ```
96
+
97
+ If you call a full-app feature on a slim install, you'll get a clear message telling you to
98
+ `pip install "inflexa-mdvtools[app]"` rather than a cryptic import error.
99
+
100
+ ## Quickstart
101
+
102
+ Create and serve an MDV project from the `pbmc3k` example dataset. `folder` is where the
103
+ project is stored — any location you can write to; it's created if it doesn't exist.
104
+
105
+ ```python
106
+ import scanpy
107
+ from mdvtools.conversions import convert_scanpy_to_mdv
108
+ from mdvtools.serverlite import serve_project
109
+
110
+ folder = "/path/to/mytestproject"
111
+ data = scanpy.datasets.pbmc3k_processed()
112
+
113
+ project = convert_scanpy_to_mdv(folder, data)
114
+ serve_project(project) # serves at http://localhost:5050
115
+ ```
116
+
117
+ Open http://localhost:5050 in your browser to explore the project. The project files live in
118
+ `folder` and can be re-served later or exported as a static site.
119
+
120
+ There's also a command-line interface:
121
+
122
+ ```bash
123
+ mdvtools --help
124
+ ```
125
+
126
+ ## License
127
+
128
+ GPL-3.0-only. See the [fork repository](https://github.com/inflexa-ai/MDV) and the [upstream repository](https://github.com/Taylor-CCB-Group/MDV).
@@ -0,0 +1,68 @@
1
+ # inflexa-mdvtools
2
+
3
+ `inflexa-mdvtools` is a fork of `mdvtools` 1.3.0, the Python package of the Multi-Dimensional Viewer (MDV).
4
+ The fork changes the dependency pins of `mdvtools` to version ranges.
5
+ These ranges include the package versions of the Inflexa package store, for example anndata 0.13, spatialdata 0.8, and numpy 2.5.
6
+ The fork also has the code changes that make the conversions work on these versions.
7
+ The import name stays `mdvtools`.
8
+
9
+ - Fork source: https://github.com/inflexa-ai/MDV (branch `inflexa`)
10
+ - Upstream: https://github.com/Taylor-CCB-Group/MDV (tag `v1.3.0`)
11
+
12
+ Do not install `inflexa-mdvtools` and `mdvtools` in the same environment, because each package gives the `mdvtools` module.
13
+
14
+ ## About MDV Tools
15
+
16
+ **Multi-Dimensional Viewer (MDV)** is a web-based application for analysing and visualising
17
+ large, multi-dimensional data (single-cell, spatial, and general tabular data). `mdvtools`
18
+ is the Python package for **creating, manipulating, and viewing MDV projects** — including a
19
+ lightweight local server and the ability to export a project as a static website.
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ pip install inflexa-mdvtools
25
+ ```
26
+
27
+ This installs the **slim core**: everything you need to build, manipulate, view, and serve
28
+ MDV projects, including spatial-data support.
29
+
30
+ For the **full application** — database-backed project management, the chat/LLM assistant,
31
+ and authentication — install the `app` extra:
32
+
33
+ ```bash
34
+ pip install "inflexa-mdvtools[app]"
35
+ ```
36
+
37
+ If you call a full-app feature on a slim install, you'll get a clear message telling you to
38
+ `pip install "inflexa-mdvtools[app]"` rather than a cryptic import error.
39
+
40
+ ## Quickstart
41
+
42
+ Create and serve an MDV project from the `pbmc3k` example dataset. `folder` is where the
43
+ project is stored — any location you can write to; it's created if it doesn't exist.
44
+
45
+ ```python
46
+ import scanpy
47
+ from mdvtools.conversions import convert_scanpy_to_mdv
48
+ from mdvtools.serverlite import serve_project
49
+
50
+ folder = "/path/to/mytestproject"
51
+ data = scanpy.datasets.pbmc3k_processed()
52
+
53
+ project = convert_scanpy_to_mdv(folder, data)
54
+ serve_project(project) # serves at http://localhost:5050
55
+ ```
56
+
57
+ Open http://localhost:5050 in your browser to explore the project. The project files live in
58
+ `folder` and can be re-served later or exported as a static site.
59
+
60
+ There's also a command-line interface:
61
+
62
+ ```bash
63
+ mdvtools --help
64
+ ```
65
+
66
+ ## License
67
+
68
+ GPL-3.0-only. See the [fork repository](https://github.com/inflexa-ai/MDV) and the [upstream repository](https://github.com/Taylor-CCB-Group/MDV).
@@ -0,0 +1,20 @@
1
+ """
2
+ MDVTools - Multi-Dimensional Viewer Python API
3
+
4
+ Provides tools for creating, configuring, and managing MDV projects.
5
+ """
6
+
7
+ from .mdvproject import MDVProject
8
+ from .network_helpers import (
9
+ setup_ligand_network,
10
+ create_ligand_network_view,
11
+ setup_cell_communication_network,
12
+ )
13
+
14
+ __all__ = [
15
+ "MDVProject",
16
+ "setup_ligand_network",
17
+ "create_ligand_network_view",
18
+ "setup_cell_communication_network",
19
+ ]
20
+
@@ -0,0 +1,45 @@
1
+ """Helpers for optional dependency groups (PEP 621 extras).
2
+
3
+ The database/server, chat/LLM and auth stack ships behind the single ``app``
4
+ extra (``pip install "inflexa-mdvtools[app]"``). A bare ``pip install inflexa-mdvtools`` is the
5
+ slim core (project manipulation, viewing, ``MDVProject.serve()``).
6
+
7
+ Modules that import the ``app`` stack at top level call :func:`require_extra`
8
+ *before* those imports, so a slim install fails with an actionable message
9
+ instead of a bare ``ModuleNotFoundError`` from a transitive package name the
10
+ user has never heard of.
11
+ """
12
+ from __future__ import annotations
13
+
14
+ import importlib.util
15
+
16
+
17
+ def _available(package: str) -> bool:
18
+ """Return True if ``package`` can be imported, without importing it."""
19
+ try:
20
+ return importlib.util.find_spec(package) is not None
21
+ except (ImportError, ValueError):
22
+ # A parent package is itself missing/broken — treat as unavailable.
23
+ return False
24
+
25
+
26
+ def require_extra(extra: str, *packages: str) -> None:
27
+ """Raise a friendly error if any of ``packages`` is not importable.
28
+
29
+ Call at the top of a module, above its optional top-level imports::
30
+
31
+ from mdvtools._optional import require_extra
32
+ require_extra("app", "langchain_openai")
33
+
34
+ from langchain_openai import ChatOpenAI # safe below the guard
35
+
36
+ ``packages`` are *import* names to probe (e.g. ``"flask_sqlalchemy"``),
37
+ chosen to be present only when ``extra`` is installed.
38
+ """
39
+ missing = [p for p in packages if not _available(p)]
40
+ if missing:
41
+ raise ModuleNotFoundError(
42
+ f"This feature requires the optional '{extra}' dependencies "
43
+ f"(missing: {', '.join(missing)}).\n"
44
+ f'Install them with: pip install "inflexa-mdvtools[{extra}]"'
45
+ )
File without changes